RFR: 8367324: Avoid redundant parsing when formatting with DigitList [v2]
Johannes Graham
duke at openjdk.org
Wed Sep 10 23:47:48 UTC 2025
On Wed, 10 Sep 2025 21:06:53 GMT, Justin Lu <jlu at openjdk.org> wrote:
>> Johannes Graham has updated the pull request incrementally with two additional commits since the last revision:
>>
>> - use Level.Invocation
>> - review fixes
>
> test/micro/org/openjdk/bench/java/text/DefFormatterBench.java line 100:
>
>> 98: // of the toString value if the BigDecimal instance was reused.
>> 99:
>> 100: BigDecimal bd = new BigDecimal(value.unscaledValue(), value.scale());
>
> If we use `@Setup(Level.Iteration)` on setup, I believe we can ensure a fresh `bdValues` for each benchmark iteration measurement. Then we can remove the BD recreation to not be included within the benchmark results which should give us more accurate results.
Looks like `Level.Invocation` is the one I want.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/27118#discussion_r2338174523
More information about the core-libs-dev
mailing list