On Fri, 18 Oct 2024 21:56:53 GMT, Shaojin Wen <s...@openjdk.org> wrote:
>> After PR https://github.com/openjdk/jdk/pull/16245, C2 optimizes stores into >> primitive arrays by combining values into larger stores. >> >> This PR rewrites the code of appendNull and append(boolean) methods so that >> these two methods can be optimized by C2. > > Shaojin Wen has updated the pull request with a new target base due to a > merge or a rebase. The incremental webrev excludes the unrelated changes > brought in by the merge/rebase. The pull request contains 26 additional > commits since the last revision: > > - Merge remote-tracking branch 'origin/optim_str_builder_append_202406' into > optim_str_builder_append_202406 > - fix build error > - Merge remote-tracking branch 'upstream/master' into > optim_str_builder_append_202406 > - Merge remote-tracking branch 'upstream/master' into > optim_str_builder_append_202406 > - Merge remote-tracking branch 'origin/optim_str_builder_append_202406' into > optim_str_builder_append_202406 > - Merge remote-tracking branch 'upstream/master' into > optim_str_builder_append_202406 > - Merge remote-tracking branch 'upstream/master' into > optim_str_builder_append_202406 > - revert test > - Merge remote-tracking branch 'upstream/master' into > optim_str_builder_append_202406 > - Merge remote-tracking branch 'upstream/master' into > optim_str_builder_append_202406 > - ... and 16 more: https://git.openjdk.org/jdk/compare/2cc7136e...457735c9 After PR 19970, the performance has been significantly improved. Below are the performance numbers for AMD CPU (x64) ## Script git remote add wenshao g...@github.com:wenshao/jdk.git git fetch wenshao # pr 19626 git clone 58dae7888eceb1c61243f658b67c208e6c30f7f2 make test TEST="micro:java.lang.StringBuilders.appendWithNull8Latin1" # pr 19626 + 19970 git clone 457735c920aad822557e68e75ba1e76811c855a4 make test TEST="micro:java.lang.StringBuilders.appendWithNull8Latin1" ## performance numbers -Benchmark Mode Cnt Score Error Units (pr 19626) -StringBuilders.appendWithNull8Latin1 avgt 15 8.316 ± 0.512 ns/op +Benchmark Mode Cnt Score Error Units (pr 19626 + 19970) +StringBuilders.appendWithNull8Latin1 avgt 15 5.891 ± 0.043 ns/op ------------- PR Comment: https://git.openjdk.org/jdk/pull/19626#issuecomment-2423368506