2. @tomvleminckx#Devoxx #Jmh
Bio
• @tomvleminckx & linkedin.com/in/tvleminckx
• Architect & Lead of Foundation/R&D team Clear2Pay
(now part of FIS)
• Special interest in fintech, performance tuning,
monitoring & operational intelligence
5. @tomvleminckx#Devoxx #Jmh
Benchmarking is hard, really hard
• Multi-threading
• Mistakes/limits/knowledge – JMM, measure time, stats
• JIT & CPU (inlining, constant folding, loop unrolling, false
sharing, …)
• Should you write your own framework?
6. @tomvleminckx#Devoxx #Jmh
Use JMH
• Java Micro(*)benchmark Harness (JMH)
• Openjdk tool (JIT crowd)
• Write-Run-Profile-Report benchmarks
• Abstracts away the hard part, @-based
7. @tomvleminckx#Devoxx #Jmh
Write
• Maven archetype to setup project
• But I’ll be using Gradle
• Multiple JVM languages supported
• @-based
• code generation
• @Setup @Benchmark @TearDown
13. @tomvleminckx#Devoxx #Jmh
Next/Pointers
• Want to learn more?
• http://openjdk.java.net/projects/code-tools/jmh/
• http://hg.openjdk.java.net/code-tools/jmh/file/tip/jmh-
samples/src/main/java/org/openjdk/jmh/samples
• Get the examples of this talk
• https://github.com/tvleminckx/jmh-devoxx-tia