RFR: 8357823: Changes in StringBuilder (JDK-8351443) caused a 1-3% regression in biojava [v2]
Roger Riggs
rriggs at openjdk.org
Fri Jul 18 14:38:57 UTC 2025
On Wed, 11 Jun 2025 11:35:09 GMT, Roger Riggs <rriggs at openjdk.org> wrote:
>> Comment out assertions added in JDK-8351443 from AbstractStringBuilder.ensureCapacityNewCoder that increase the codesize, preventing some inlining, and reducing performance
>>
>> assert coder == newCoder || newCoder == UTF16 : "bad new coder UTF16 -> LATIN1";
>> assert count <= newCapacity : "count exceeds new capacity";
>
> Roger Riggs has updated the pull request incrementally with one additional commit since the last revision:
>
> Microbenchmark java.lang.StringBuilders is modified to not re-use existing StringBuilders
> in the appendWithXXX benchmarks.
> The StringBuilders sbLatin1 and sbUtf15 are created as re-only for specific test cases.
> Re-using and setting the length to zero, makes the test suseptable to variations
> depend on the order of execution of the the benchmarks because the buffers may or
> may not have to been re-sized based on the previous test cases.
The specific patch suggested did not resolve the performance deficit.
Several other refactorings did not yield reliable improvement across all architectures and platforms including several refactorings that move high frequency paths into the public methods or the direct support methods.
Reverting to the original code would undo the integrity goals of JDK-8351443.
Offline discussion suggested that additional work on the optimizations in HotSpot may be needed, but the timeline is not known.
With RPD2 for JDK 25 past, closing until a better improvement can be found.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/25550#issuecomment-3089698531
PR Comment: https://git.openjdk.org/jdk/pull/25550#issuecomment-3089701809
More information about the core-libs-dev
mailing list