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



##########
File path: README.md
##########
@@ -199,6 +199,27 @@ You can run spotbugs using:
 The spotbugs warnings will be found in `reports/spotbugs/main.html` and 
`reports/spotbugs/test.html` files in the subproject build
 directories.  Use -PxmlSpotBugsReport=true to generate an XML report instead 
of an HTML one.
 
+### JMH microbenchmarks ###
+We use [JMH](https://openjdk.java.net/projects/code-tools/jmh/) to write 
microbenchmarks that produce reliable results in the JVM.
+You can run all the benchmarks using:
+
+    ./jmh-benchmarks/jmh.sh
+    
+Pass a pattern or name after the command to select the benchmarks, for example:
+
+    ./jmh-benchmarks/jmh.sh LRUCacheBenchmark
+
+It's good practice to check profiler output for microbenchmarks in order to 
verify that they are valid.

Review comment:
       Rather than "in order to verify that they are valid", how about "in 
order to verify that they are measuring what you think they are. For example, 
if you use mocks they may use reflection that can easily dominate the 
benchmark's run time.".




----------------------------------------------------------------
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


Reply via email to