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
sullis
March 14, 2023
Programming
170
0
Share
Microbenchmarking with JMH - Portland 2023-03-14
Microbenchmarking with JMH
Portland Java User Group
March 14, 2023
Portland Oregon
sullis
March 14, 2023
More Decks by sullis
See All by sullis
AI Assisted Software Development - Portland Java User Group - 2026-04-14
sullis
0
43
Dependency Management for Java - Seattle 2025-11-18
sullis
0
44
Dependency Management for Java - Portland - 2025-11-04
sullis
0
26
Dependency management for Java applications 2025-09-11
sullis
0
35
S3 NYC Iceberg meetup 2025-07-10
sullis
0
55
Amazon S3 Chicago 2025-06-04
sullis
0
130
Amazon S3 Boston 2025-05-07
sullis
0
100
Netty ConFoo Montreal 2025-02-27
sullis
0
160
GitHub Actions ConFoo Montreal 2025-02-26
sullis
0
100
Other Decks in Programming
See All in Programming
Coding as Prompting Since 2025
ragingwind
0
830
ファインチューニングせずメインコンペを解く方法
pokutuna
0
310
実用!Hono RPC2026
yodaka
2
220
Claude Code × Gemini × Ebitengine ゲーム制作素人WebエンジニアがGoでゲームを作った話
webzawa
0
130
iOS機能開発のAI環境と起きた変化
ryunakayama
0
180
ルールルルルルRubyの中身の予備知識 ── RubyKaigiの前に予習しなイカ?
ydah
1
180
VueエンジニアがReactを触って感じた_設計の違い
koukimiura
0
170
mruby on C#: From VM Implementation to Game Scripting (RubyKaigi 2026)
hadashia
2
370
PHPで TLSのプロトコルを実装してみるをもう一度しゃべりたい
higaki_program
0
200
HTML-Aware ERB: The Path to Reactive Rendering @ RubyKaigi 2026, Hakodate, Japan
marcoroth
0
130
感情を設計する
ichimichi
5
1.5k
Making the RBS Parser Faster
soutaro
0
300
Featured
See All Featured
What does AI have to do with Human Rights?
axbom
PRO
1
2.1k
How to build a perfect <img>
jonoalderson
1
5.4k
Discover your Explorer Soul
emna__ayadi
2
1.1k
Avoiding the “Bad Training, Faster” Trap in the Age of AI
tmiket
0
130
Measuring Dark Social's Impact On Conversion and Attribution
stephenakadiri
1
190
Building Better People: How to give real-time feedback that sticks.
wjessup
370
20k
Build The Right Thing And Hit Your Dates
maggiecrowley
39
3.1k
The Invisible Side of Design
smashingmag
302
52k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
254
22k
Applied NLP in the Age of Generative AI
inesmontani
PRO
4
2.2k
VelocityConf: Rendering Performance Case Studies
addyosmani
333
25k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
1.9k
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