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
8267840: Improve URLStreamHandler.parseURL() #4526
Conversation
👋 Welcome back stsypanov! A progress list of the required criteria for merging this PR into |
@stsypanov The following label will be automatically applied to this pull request:
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. |
Webrevs
|
Hi Sergey, The logics seems correct - but what test did you run? have you run tier1 and tier2? best regards, |
Hi Daniel, tier1 and tier2 is ok in pipeline, but locally I'm facing
I configure and run tests with
|
Hi Sergey, That exception means you're using an obsolete version of jtreg: you need jtreg-6+1 now. best regards, |
@dfuch I've fixed the issue and retested the changes, tier1 is ok, in tier2 some IPv6 tests on my machine are failing, but they fail both on |
if (ind < 0) { | ||
path = "/"; | ||
} else { | ||
path = path.substring(0, ind).concat("/"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would that be equivalent to
path = path.substring(0, ind + 1);
given that ind = path.lastIndexOf('/') ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, fixed!
…ing.concat() call
@stsypanov This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration! |
Let's wait |
Thanks for waiting - and sorry for the delay. I want to send this PR through our test system before approving, but things LGTM so far. |
|
@stsypanov 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:
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 471 new commits pushed to the
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 (@dfuch, @cl4es) but any other Committer may sponsor as well. ➡️ To flag this PR as ready for integration with the above commit message, type |
/integrate |
@stsypanov |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
/sponsor
/sponsor |
Going to push as commit d7fc9e4.
Your commit was automatically rebased without conflicts. |
@cl4es @stsypanov Pushed as commit d7fc9e4. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
There is an optimization opportunity for the widespread use-case when a resource is read from classpath using
getClass().getClassLoader().getResource()
orgetClass().getClassLoader().getResourceAsStream()
.Pay attention to lines starting from 261. In case I run something like
I get into the if-else block starting from 251 and here 'separator' variable is an empty String. In this case we can skip 'separator' from concatenation chain and use
String.concat()
as there are only two items concatenated.In the opposite case
separator
variable is"/"
and at the same timeind
variable is-1
. This means that expressionpath.substring(0, ind + 1)
always returns an empty String and again can be excluded from concatenation chain allowing usage ofString.concat()
which allows to dodge utilization ofStringBuilder
(hereStringConcatFactory
is not available, see #3627)In the next else-block, starting from 274, again,
String.concat()
is applicable.In another if-else block, starting from 277, when id is 0 again path.substring(0, ind) returns empty String making concatenation pointless and avoidable.
There are also some other minor clean-ups possible regarding constant conditions (lines 252 and 161).
The change allows to reduce significantly resource look-up costs for a very wide-spread case:
The change allows to reduce memory consumption significantly:
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/4526/head:pull/4526
$ git checkout pull/4526
Update a local copy of the PR:
$ git checkout pull/4526
$ git pull https://git.openjdk.java.net/jdk pull/4526/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 4526
View PR using the GUI difftool:
$ git pr show -t 4526
Using diff file
Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/4526.diff