RFR: 8260043: Reduce allocation in sun.net.www.protocol.jar.Handler.parseURL [v3]

Eirik Bjorsnos github.com+300291+eirbjo at openjdk.java.net
Thu Jan 21 10:07:16 UTC 2021


> By moving string splitting and concatenation into the canonizeString utility, we can defer allocation until we determine that canonization is required. This saves two string allocations and a string concat for the common case where canonization is not required.
> 
> As a refactoring, move ParseUtil.canonizeString/doCanonize into Handler since that's the only call site.
> 
> Finally, let's rename the method to canonizalizeString, since canonization is an rather unrelated term.

Eirik Bjorsnos has updated the pull request incrementally with one additional commit since the last revision:

  Replace "canoize" with "canonicalize" in a code comment which left out in the code renaming

-------------

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/2167/files
  - new: https://git.openjdk.java.net/jdk/pull/2167/files/f4b543d6..0be597b1

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=2167&range=02
 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=2167&range=01-02

  Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod
  Patch: https://git.openjdk.java.net/jdk/pull/2167.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/2167/head:pull/2167

PR: https://git.openjdk.java.net/jdk/pull/2167


More information about the net-dev mailing list