RFR: 8370013: Refactor Double.toHexString to eliminate regex and StringBuilder [v3]
Shaojin Wen
swen at openjdk.org
Mon Oct 20 14:46:22 UTC 2025
> This PR refactors the Double.toHexString method to improve its performance by eliminating the use of StringBuilder and regex operations. The new implementation uses a direct byte array approach to construct the hex string representation, which avoids the overhead of StringBuilder operations and regex pattern matching.
>
> Existing tests in `java/lang/Double/ToHexString.java`.
Shaojin Wen has updated the pull request incrementally with one additional commit since the last revision:
Update src/java.base/share/classes/java/lang/Double.java
Co-authored-by: Raffaello Giulietti <raffaello.giulietti at oracle.com>
-------------
Changes:
- all: https://git.openjdk.org/jdk/pull/27811/files
- new: https://git.openjdk.org/jdk/pull/27811/files/31e776dd..cf7e1801
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jdk&pr=27811&range=02
- incr: https://webrevs.openjdk.org/?repo=jdk&pr=27811&range=01-02
Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod
Patch: https://git.openjdk.org/jdk/pull/27811.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/27811/head:pull/27811
PR: https://git.openjdk.org/jdk/pull/27811
More information about the core-libs-dev
mailing list