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

Raffaello Giulietti rgiulietti at openjdk.org
Mon Oct 20 15:42:05 UTC 2025


On Mon, 20 Oct 2025 15:37:40 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

Ah OK, thanks.
I currently have nothing more to add.

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

PR Comment: https://git.openjdk.org/jdk/pull/27811#issuecomment-3422636047


More information about the core-libs-dev mailing list