Microbenchmarking Applications with JMH

In the previous chapter, we took an in-depth review of garbage collection to include an object life cycle, garbage collection algorithms, garbage collection options, and methods related to garbage collection. We took a brief look at upgrades to garbage collection in Java 8 and focused on changes with the new Java platform. Our exploration of garbage collection in Java 11 included looks at default garbage collection, depreciated garbage collection combinations, unified garbage collection logging, and garbage collection issues that persist.

In this chapter, we will look at how to write performance tests using the Java Microbenchmark Harness (JMH), a Java harness library for writing benchmarks for the JVM. We will use Maven along with JMH to help illustrate the power of microbenchmarking with the new Java platform.

Specifically, we will cover the following topics:

  • Microbenchmarking overview
  • Microbenchmarking with Maven
  • Benchmarking options
  • Techniques for avoiding microbenchmarking pitfalls
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset