parttimenerd / sampler-comparison

Compare different method samplers for Java

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Sampler Comparison

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:

  1. A measure of the actual interval between samples, which should be close to 10ms in the default configuration
  2. A measure of sample overlap

Build

mvn package

Run

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

License

MIT, Copyright 2024 SAP SE or an SAP affiliate company, Johannes Bechberger and contributors

About

Compare different method samplers for Java


Languages

Language:Java 100.0%