Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
wants to merge 5 commits into from

Conversation

eirbjo
Copy link
Contributor

@eirbjo eirbjo commented Jan 20, 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.

/issue 8260043


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed

Issue

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

Reviewers

Download

$ git fetch https://git.openjdk.java.net/jdk pull/2167/head:pull/2167
$ git checkout pull/2167

@bridgekeeper
Copy link

bridgekeeper bot commented Jan 20, 2021

👋 Welcome back eirbjo! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk openjdk bot added the rfr Pull request is ready for review label Jan 20, 2021
@openjdk
Copy link

openjdk bot commented Jan 20, 2021

@eirbjo This issue is referenced in the PR title - it will now be updated.

@openjdk
Copy link

openjdk bot commented Jan 20, 2021

@eirbjo The following label will be automatically applied to this pull request:

  • net

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added the net net-dev@openjdk.org label Jan 20, 2021
@mlbridge
Copy link

mlbridge bot commented Jan 20, 2021

Webrevs

Copy link
Member

@cl4es cl4es left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - just a small nit that you seem to have forgotten to change canonize to canonicalize in some places.

@openjdk
Copy link

openjdk bot commented Jan 20, 2021

@eirbjo This change now passes all automated pre-integration checks.

ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details.

After integration, the commit message for the final commit will be:

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

Reviewed-by: redestad, chegar

You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been 53 new commits pushed to the master branch:

As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.

As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@cl4es, @ChrisHegarty) but any other Committer may sponsor as well.

➡️ To flag this PR as ready for integration with the above commit message, type /integrate in a new comment. (Afterwards, your sponsor types /sponsor in a new comment to perform the integration).

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Jan 20, 2021
… should also be renamed. This was an oversight in the original PR.
@eirbjo
Copy link
Contributor Author

eirbjo commented Jan 20, 2021

Newbie question: Is a copyright year updates required when code is simply moved around like this?

More specifically, is it required when strictly deleting code from a file, like ParseUtil in this case?

Copy link
Member

@ChrisHegarty ChrisHegarty left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

@openjdk
Copy link

openjdk bot commented Jan 21, 2021

⚠️ @eirbjo the full name on your profile does not match the author name in this pull requests' HEAD commit. If this pull request gets integrated then the author name from this pull requests' HEAD commit will be used for the resulting commit. If you wish to push a new commit with a different author name, then please run the following commands in a local repository of your personal fork:

$ git checkout url-canonize
$ git commit -c user.name='Preferred Full Name' --allow-empty -m 'Update full name'
$ git push

@eirbjo
Copy link
Contributor Author

eirbjo commented Jan 21, 2021

/integrate

@openjdk openjdk bot added the sponsor Pull request is ready to be sponsored label Jan 21, 2021
@openjdk
Copy link

openjdk bot commented Jan 21, 2021

@eirbjo
Your change (at version f4b543d) is now ready to be sponsored by a Committer.

@openjdk openjdk bot removed the sponsor Pull request is ready to be sponsored label Jan 21, 2021
@ChrisHegarty
Copy link
Member

Newbie question: Is a copyright year updates required when code is simply moved around like this?

More specifically, is it required when strictly deleting code from a file, like ParseUtil in this case?

I would prefer if the copyright year range was updated in these files - this is a non-trivial change.

Copy link
Member

@cl4es cl4es left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. (You need to cast /integrate again for us to be able to /sponsor)

@eirbjo
Copy link
Contributor Author

eirbjo commented Jan 21, 2021

/integrate

@openjdk openjdk bot added the sponsor Pull request is ready to be sponsored label Jan 21, 2021
@openjdk
Copy link

openjdk bot commented Jan 21, 2021

@eirbjo
Your change (at version 7bde5f1) is now ready to be sponsored by a Committer.

@cl4es
Copy link
Member

cl4es commented Jan 21, 2021

/sponsor

@openjdk openjdk bot closed this Jan 21, 2021
@openjdk openjdk bot added the integrated Pull request has been integrated label Jan 21, 2021
@openjdk openjdk bot removed sponsor Pull request is ready to be sponsored ready Pull request is ready to be integrated rfr Pull request is ready for review labels Jan 21, 2021
@openjdk
Copy link

openjdk bot commented Jan 21, 2021

@cl4es @eirbjo Since your change was applied there have been 54 commits pushed to the master branch:

Your commit was automatically rebased without conflicts.

Pushed as commit e1de0bf.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
integrated Pull request has been integrated net net-dev@openjdk.org
4 participants