Integrated: 8260043: Reduce allocation in sun.net.www.protocol.jar.Handler.parseURL

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


On Wed, 20 Jan 2021 15:25:18 GMT, Eirik Bjorsnos <github.com+300291+eirbjo at openjdk.org> wrote:

> 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.

This pull request has now been integrated.

Changeset: e1de0bf8
Author:    Eirik Bjorsnos <eirbjo at gmail.com>
Committer: Claes Redestad <redestad at openjdk.org>
URL:       https://git.openjdk.java.net/jdk/commit/e1de0bf8
Stats:     98 lines in 2 files changed: 47 ins; 47 del; 4 mod

8260043: Reduce allocation in sun.net.www.protocol.jar.Handler.parseURL

Reviewed-by: redestad, chegar

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

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


More information about the net-dev mailing list