lbradstreet commented on a change in pull request #9129: URL: https://github.com/apache/kafka/pull/9129#discussion_r478635770
########## File path: jmh-benchmarks/README.md ########## @@ -34,7 +34,18 @@ the jmh.sh script from the jmh-benchmarks module. * By default all JMH output goes to stdout. To run a benchmark and capture the results in a file: `./jmh.sh -f 2 -o benchmarkResults.txt LRUCacheBenchmark` NOTE: For now this script needs to be run from the jmh-benchmarks directory. + +### Using JMH with async-profiler + +It's good practice to check profiler output for microbenchmarks in order to verify that they are valid. +JMH includes [async-profiler](https://github.com/jvm-profiling-tools/async-profiler) integration that makes this easy: + LD_LIBRARY_PATH=/path/to/async-profiler ./jmh-benchmarks/jmh.sh -prof async + +A number of arguments can be passed to async-profiler, run the following for a description: + + ./jmh-benchmarks/jmh.sh -prof async:help + Review comment: Suggested addition: ### Using JMH GC profiler It's good practice to run your benchmark with -prof gc to measure the allocation rate for your code: ./jmh-benchmarks/jmh.sh -prof gc Of particular importance is the "norm" alloc rates, which measure the allocations per operation rather than allocations per second which can increase when you have made your code faster. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org