Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Microbenchmarking with JMH - Portland 2023-03-14
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
sullis
March 14, 2023
Programming
0
160
Microbenchmarking with JMH - Portland 2023-03-14
Microbenchmarking with JMH
Portland Java User Group
March 14, 2023
Portland Oregon
sullis
March 14, 2023
Tweet
Share
More Decks by sullis
See All by sullis
Dependency Management for Java - Seattle 2025-11-18
sullis
0
35
Dependency Management for Java - Portland - 2025-11-04
sullis
0
20
Dependency management for Java applications 2025-09-11
sullis
0
30
S3 NYC Iceberg meetup 2025-07-10
sullis
0
52
Amazon S3 Chicago 2025-06-04
sullis
0
130
Amazon S3 Boston 2025-05-07
sullis
0
97
Netty ConFoo Montreal 2025-02-27
sullis
0
140
GitHub Actions ConFoo Montreal 2025-02-26
sullis
0
97
Netty Portland Java User Group 2025-02-18
sullis
0
33
Other Decks in Programming
See All in Programming
Claude Codeログ基盤の構築
giginet
PRO
2
690
モジュラモノリスにおける境界をGoのinternalパッケージで守る
magavel
0
3.5k
encoding/json/v2のUnmarshalはこう変わった:内部実装で見る設計改善
kurakura0916
0
390
20260228_JAWS_Beginner_Kansai
takuyay0ne
5
470
Codexに役割を持たせる 他のAIエージェントと組み合わせる実務Tips
o8n
3
1.2k
Takumiから考えるSecurity_Maturity_Model.pdf
gessy0129
1
140
AI主導でFastAPIのWebサービスを作るときに 人間が構造化すべき境界線
okajun35
0
670
CSC307 Lecture 14
javiergs
PRO
0
470
maplibre-gl-layers - 地図に移動体たくさん表示したい
kekyo
PRO
0
230
What Spring Developers Should Know About Jakarta EE
ivargrimstad
0
340
AIコーディングの理想と現実 2026 | AI Coding: Expectations vs. Reality 2026
tomohisa
0
1.2k
AIに任せる範囲を安全に広げるためにやっていること
fukucheee
0
130
Featured
See All Featured
Getting science done with accelerated Python computing platforms
jacobtomlinson
2
140
The Language of Interfaces
destraynor
162
26k
A designer walks into a library…
pauljervisheath
210
24k
Balancing Empowerment & Direction
lara
5
940
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
22k
Why Mistakes Are the Best Teachers: Turning Failure into a Pathway for Growth
auna
0
77
How GitHub (no longer) Works
holman
316
140k
Un-Boring Meetings
codingconduct
0
220
Evolving SEO for Evolving Search Engines
ryanjones
0
150
Avoiding the “Bad Training, Faster” Trap in the Age of AI
tmiket
0
97
From Legacy to Launchpad: Building Startup-Ready Communities
dugsong
0
170
Ethics towards AI in product and experience design
skipperchong
2
220
Transcript
Microbenchmarking with JMH Sean Sullivan Portland Java User Group March
14, 2023
Java Microbenchmark Harness “JMH is a Java harness for building,
running, and analysing nano/micro/milli/macro benchmarks written in Java and other languages targeting the JVM.”
OSS projects that use JMH • Netty • Log4j2 •
Spring Framework • Apache Cassandra • Apache Kafka • Netflix Atlas • Netflix Spectator • Netflix Zuul
NOTE: JMH is not intended to be used in the
same way as a typical testing library such as JUnit. Simply adding the jmh-core jar file to your build is not enough to be able to run benchmarks.
“the key to using JMH is enabling the annotation- or
bytecode-processors to generate the synthetic benchmark code”
“Running benchmarks from the IDE is generally not recommended due
to generally uncontrolled environment in which the benchmarks run.”
Zuul: HeadersBenchmark
Zuul: HeadersBenchmark
Zuul: HeadersBenchmark
Zuul: HeadersBenchmark
Zuul: build.gradle jmh-gradle-plugin
Zuul: HeadersBenchmark ./gradlew --no-daemon clean :zuul-core:jmh
Learning JMH
Learning JMH
Learning JMH
microbenchmarks-java • CompressionBenchmark • CounterBenchmark • HttpHeadersBenchmark • Log4j2ClockBenchmark •
RandomBenchmark • UuidBenchmark
CompressionBenchmark • Goal: measure throughput of Gzip compression • Goal:
measure throughput of Brotli compression • Goal: evaluate Brotli compression parameters
CompressionBenchmark public enum CompressionType • GZIP • BROTLI_0 • BROTLI_4
• BROTLI_11
CompressionBenchmark
CompressionBenchmark
CompressionBenchmark # JMH version: 1.36 # VM version: JDK 17.0.6,
OpenJDK 64-Bit Server VM, 17.0.6+10-LTS # Warmup: 2 iterations, 10 s each # Measurement: 5 iterations, 10 s each # Threads: 1 thread, will synchronize iterations # Benchmark mode: Throughput, ops/time
CompressionBenchmark
The End