-
Notifications
You must be signed in to change notification settings - Fork 6.2k
8365832: Optimize FloatingDecimal and DigitList with byte[] and cleanup #23311
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
Conversation
|
👋 Welcome back swen! A progress list of the required criteria for merging this PR into |
|
@wenshao 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 32 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. ➡️ To integrate this PR with the above commit message to the |
|
|
||
| } | ||
|
|
||
| private static final ThreadLocal<BinaryToASCIIBuffer> threadLocalBinaryToASCIIBuffer = |
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.
Why was this thread local buffer removed?
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.
Creating a BinaryToASCIIConverter is not expensive and does not require the use of cache, but this should be proven by performance testing.
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.
Each BinaryToASCIIBuffer allocates an array for digits. That might be why the buffer was added. @rgiulietti might decide if this removal is fine or if we should keep it.
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.
It is interesting to note that that DigitList, which I think is the only remaining consumer of BinaryToAsciiBuffer reparses the string to separate the exponent and the mantissa. The converter has those separately and getChars does work to stick them together into a string. If the removal of the thread local has a noticeable performance impact, there is an opportunity to eliminate some allocations by having DigitList access the exponent and mantissa directly from the converter without needing toJavaFormatString
|
@wenshao This pull request has been inactive for more than 8 weeks and will be automatically closed if another 8 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! |
|
@wenshao How about extracting a new PR from this that only deals with removing the unused code? |
Yes, but I will wait until after June 5th so that it does not affect the release of JDK 25. |
bfbe256 to
7e33814
Compare
|
@wenshao I'm working on a general overhaul of FloatingDecimal and related classes in some current and future PRs. If you could restrict your changes to just DigitList, that would be less interference with my work. |
@rgiulietti Sorry, I was traveling last week and I just saw your comment now. This is a draft pull request, you can move on with your plans and ignore it. |
|
@wenshao 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 issue a |
|
/touch |
|
@wenshao The pull request is being re-evaluated and the inactivity timeout has been reset. |
|
@wenshao this pull request can not be integrated into git checkout floating_dec_202501
git fetch https://git.openjdk.org/jdk.git master
git merge FETCH_HEAD
# resolve conflicts and follow the instructions given by git merge
git commit -m "Merge master"
git push |
9803197 to
ebc4bc2
Compare
|
@wenshao While I didn't check all the details, I think these changes look OK. |
|
@wenshao In the initial description, there's a mention to reuse |
Thanks @rgiulietti for the reminder, the original description is outdated and has been updated. |
…inflateBytesToChars Co-authored-by: Qwen-Coder <[email protected]>
|
@wenshao There are several tests that fail, in particular in |
src/java.base/share/classes/jdk/internal/math/FloatingDecimal.java
Outdated
Show resolved
Hide resolved
src/java.base/share/classes/jdk/internal/math/FloatingDecimal.java
Outdated
Show resolved
Hide resolved
zimmi
left a comment
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.
I'm not an official reviewer, but looks good to me 👍
P.S.: While looking why you might have preferred ISO_8859_1 over US_ASCII (latin1 can skip the mapping of replacement characters because it defines the entire byte range, correct?), I stumbled upon a reference to the removed SecurityManager in a comment.
|
@zimmi, I created a simple issue for this outdated comment at https://bugs.openjdk.org/browse/JDK-8365887 |
rgiulietti
left a comment
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.
Looks good.
Thanks @wenshao and the other participants.
|
/integrate |
|
/touch |
|
Going to push as commit dba0d54.
Your commit was automatically rebased without conflicts. |
|
@liach The command |
Since FloatToDecimal and DoubleToDecimal are used in Float.toString and Double.toString, some code in FloatingDecimal is not used.
This PR refactors
FloatingDecimalandDigitListto improve efficiency and reduce code duplication.Key changes:
char[]tobyte[]for reduced memory footprint.Progress
Issue
Reviewers
Reviewers without OpenJDK IDs
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/23311/head:pull/23311$ git checkout pull/23311Update a local copy of the PR:
$ git checkout pull/23311$ git pull https://git.openjdk.org/jdk.git pull/23311/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 23311View PR using the GUI difftool:
$ git pr show -t 23311Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/23311.diff
Using Webrev
Link to Webrev Comment