neo4j-contrib / neo4j-graph-algorithms

Efficient Graph Algorithms for Neo4j
https://github.com/neo4j/graph-data-science/
GNU General Public License v3.0
769 stars 195 forks source link

Add FlameGraph profiler to generate flame graphs of JMH benchmarks #876

Closed knutwalker closed 5 years ago

knutwalker commented 5 years ago

To enable it, run the benchmarks with -prof org.neo4j.prof.FlameGraph. You have to download the async-profiler and point to its location with ASYNC_PROFILER_DIR=/path/to/async-profiler or by using the asyncProfiler option. Per default, the output files are saved under /tmp (or wherever java.io.tmp points to) in the org.neo4j/bench subdirectory, grouped by the benchmark class. Run with -prof org.neo4j.prof.FlameGraph:help to see all possible options.

knutwalker commented 5 years ago

Yes, I'm aware of sbt-jmh and have looked at (and used) it. The main difference is that this profiler will delegate the generation of the flame graph directly to the async-profiler instead of using an additional tool. It's a somewhat recent addition to async-profiler (1.2, I think) and the option didn't exist when Konrads profiler was written. Also, we use, in my opinion, nicer filenames by default.

knutwalker commented 5 years ago

Recent build errors are unrelated to this PR and fixed with #897