RFR: 8325403: Add SystemGC JMH benchmarks [v2]
Stefan Johansson
sjohanss at openjdk.org
Tue Feb 13 14:14:04 UTC 2024
On Mon, 12 Feb 2024 13:23:40 GMT, Stefan Johansson <sjohanss at openjdk.org> wrote:
>> Please review this change to add some System GC JMH benchmarks.
>>
>> **Summary**
>> When developing and improving the Full GC implementation for the different GCs, using `System.gc()` to test performance is sometime very useful. This change adds a set of System GC benchmarks using JMH. The tests all have the same structure, a `@Setup` function that generates heap contents and a `@Benchmark` function which only calls `System.gc()`. The different scenarios covers some basic use-cases but more can certainly be added going forward.
>>
>> Since the benchmark function is just a single call to trigger the GC it makes sense to use the single shot JMH mode and fork a new JVM for each run. The tests also specify default heap options to avoid triggering GC during object creation to give all runs more or less the same heap layout.
>>
>> **Testing**
>> Local and aurora testing verifying that results are fairly stable.
>
> Stefan Johansson has updated the pull request incrementally with one additional commit since the last revision:
>
> Restructure and rename
I pushed a change to add `+AlwaysPreTouch` to the JVM arguments, this made the total runtime like 1 minute slower on my machine, but I still think this is acceptable for performance testing. Reducing the number of forks still showed some increase in the variance so decided to keep it at 25.
Should we change the package to `org.openjdk.bench.vm.gc.systemgc` or are we ok with the underscore @tschatzl and @albertnetymk?
-------------
PR Comment: https://git.openjdk.org/jdk/pull/17784#issuecomment-1941606375
More information about the hotspot-gc-dev
mailing list