Compare different method samplers:
- JFR's standard sampler ("old sampler")
- The new CPU time sampler in JFR (see my fork for an implementation)
- A
Thread.getAllStackTraces()
based sampler (via the built-in agent), see tiny-profiler
It obtains two results:
- A measure of the actual interval between samples, which should be close to 10ms in the default configuration
- A measure of sample overlap
mvn package
Obtain the samples
java -javaagent:target/sampler-comparison.jar=depth=10 -XX:StartFlightRecording=filename=profile.jfr,settings=custom.jfc -jar renaissance.jar all
The resulting profile.jfr
and sample.txt
files can be
analyzed via:
java -jar target/sampler-comparison.jar profile.jfr sample.txt
MIT, Copyright 2024 SAP SE or an SAP affiliate company, Johannes Bechberger and contributors