RFR: 8365832: Refactor FloatingDecimal

Johannes Graham duke at openjdk.org
Wed Aug 20 07:40:24 UTC 2025


On Mon, 27 Jan 2025 00:22:42 GMT, Chen Liang <liach at openjdk.org> wrote:

>> Creating a BinaryToASCIIConverter is not expensive and does not require the use of cache, but this should be proven by performance testing.
>
> 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.

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

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

PR Review Comment: https://git.openjdk.org/jdk/pull/23311#discussion_r1931546904


More information about the core-libs-dev mailing list