kafka-jira mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [kafka] chia7712 commented on a change in pull request #9129: MINOR: Update jmh to 1.27 for async profiler support
Date Thu, 10 Dec 2020 06:44:30 GMT

chia7712 commented on a change in pull request #9129:
URL: https://github.com/apache/kafka/pull/9129#discussion_r539901142

File path: jmh-benchmarks/README.md
@@ -1,10 +1,69 @@
-### JMH-Benchmark module
+### JMH-Benchmarks module
 This module contains benchmarks written using [JMH](https://openjdk.java.net/projects/code-tools/jmh/)
from OpenJDK.
 Writing correct micro-benchmarks in Java (or another JVM language) is difficult and there
are many non-obvious pitfalls (many
 due to compiler optimizations). JMH is a framework for running and analyzing benchmarks (micro
or macro) written in Java (or
 another JVM language).
+### Running benchmarks
+If you want to set specific JMH flags or only run certain benchmarks, passing arguments via
+gradle tasks is cumbersome. These are simplified by the provided `jmh.sh` script.
+The default behavior is to run all benchmarks:
+    ./jmh-benchmarks/jmh.sh
+Pass a pattern or name after the command to select the benchmarks:
+    ./jmh-benchmarks/jmh.sh LRUCacheBenchmark
+Check which benchmarks that match the provided pattern:
+    ./jmh-benchmarks/jmh.sh -l LRUCacheBenchmark
+Run a specific test and override the number of forks, iterations and warm-up iteration to
+    ./jmh-benchmarks/jmh.sh -f 2 -i 2 -wi 2 LRUCacheBenchmark
+Run a specific test with async and GC profilers on Linux and flame graph output:
+    ./jmh-benchmarks/jmh.sh -prof gc -prof 'async:libPath=/path/to/async-profiler.so;output=flamegraph'
+The following sections cover async profiler and GC profilers in more detail.
+### 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:
+    ./jmh-benchmarks/jmh.sh -prof async:libPath=/path/to/async-profiler.so

Review comment:
       The file name of async-profiler is ```libasyncProfiler.so```. Should we follow the
naming in this example?

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:

View raw message