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

Raffaello Giulietti rgiulietti at openjdk.org
Fri Oct 4 12:31:35 UTC 2024


On Fri, 4 Oct 2024 09:34:54 GMT, fabioromano1 <duke at openjdk.org> wrote:

>> An optimized algorithm for `BigDecimal.stripTrailingZeros()` that uses repeated squares trick.
>
> fabioromano1 has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Avoid overflow of scale - preferredScale

@fabioromano1 I'll have a look once the commits settle down to something you consider stable for review.

Also, please add [JMH](https://github.com/openjdk/jmh) benchmark results with and without your changes. The benchmarks should target some public API point, like `stripTrailingZeros()`, not internal methods.

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

PR Comment: https://git.openjdk.org/jdk/pull/21323#issuecomment-2393596438


More information about the core-libs-dev mailing list