RFR: 8370013: Refactor Double.toHexString to eliminate regex and StringBuilder [v14]

Raffaello Giulietti rgiulietti at openjdk.org
Tue Oct 21 11:34:26 UTC 2025


On Tue, 21 Oct 2025 11:29:07 GMT, Shaojin Wen <swen at openjdk.org> wrote:

>> 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:
> 
>   from @rgiulietti

@wenshao Thanks for your contribution.

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

Marked as reviewed by rgiulietti (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/27811#pullrequestreview-3360117653


More information about the core-libs-dev mailing list