RFR: 8370013: Refactor Double.toHexString to eliminate regex and StringBuilder [v14]
Joe Darcy
darcy at openjdk.org
Wed Oct 22 18:36:20 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
Marked as reviewed by darcy (Reviewer).
-------------
PR Review: https://git.openjdk.org/jdk/pull/27811#pullrequestreview-3367060092
More information about the core-libs-dev
mailing list