RFR: 8341470: BigDecimal.stripTrailingZeros() optimization [v12]

fabioromano1 duke at openjdk.org
Fri Oct 4 17:54:36 UTC 2024


On Fri, 4 Oct 2024 17:48:13 GMT, Raffaello Giulietti <rgiulietti at openjdk.org> wrote:

>> @rgiulietti Which means, however, wanting to work with a precision of billions of decimal digits, and therefore taking on the consequences...
>
> It takes around 100 ms and less than 1 MB to build a table up to 20 rather than 29.
> It can be fully constructed in `static { ... }`, avoiding races.
> 
> IMO, this would cover the vast majority of the cases encountered in practice.
> Other, way less common usages with multi-millions or billions of digits would then impact running time but not _persistent_ memory footprint.
> 
> WDYT?

@rgiulietti It can be a good compromise between memory and running time...

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

PR Review Comment: https://git.openjdk.org/jdk/pull/21323#discussion_r1788087580


More information about the core-libs-dev mailing list