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
メタプログラミングで実現する「コードを仕様にする」仕組み/nikkei-tech-talk43
nikkei_engineer_recruiting
0
170
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
430
What Spring Developers Should Know About Jakarta EE
ivargrimstad
0
290
2026年は Rust 置き換えが流行る! / 20260220-niigata-5min-tech
girigiribauer
0
230
モジュラモノリスにおける境界をGoのinternalパッケージで守る
magavel
0
3.5k
new(1.26) ← これすき / kamakura.go #8
utgwkk
0
1.9k
手戻りゼロ? Spec Driven Developmentとは@KAG AI week
tmhirai
1
170
PostgreSQL を使った快適な go test 環境を求めて
otakakot
0
500
nuget-server - あなたが必要だったNuGetサーバー
kekyo
PRO
0
200
Ruby x Terminal
a_matsuda
7
590
AI駆動開発の本音 〜Claude Code並列開発で見えたエンジニアの新しい役割〜
hisuzuya
4
490
AI時代でも変わらない技術コミュニティの力~10年続く“ゆるい”つながりが生み出す価値
n_takehata
2
670
Featured
See All Featured
Building Experiences: Design Systems, User Experience, and Full Site Editing
marktimemedia
0
430
Why Mistakes Are the Best Teachers: Turning Failure into a Pathway for Growth
auna
0
76
Bioeconomy Workshop: Dr. Julius Ecuru, Opportunities for a Bioeconomy in West Africa
akademiya2063
PRO
1
68
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
49
9.9k
<Decoding/> the Language of Devs - We Love SEO 2024
nikkihalliwell
1
150
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
Visualization
eitanlees
150
17k
Leveraging LLMs for student feedback in introductory data science courses - posit::conf(2025)
minecr
1
190
Bridging the Design Gap: How Collaborative Modelling removes blockers to flow between stakeholders and teams @FastFlow conf
baasie
0
470
Stop Working from a Prison Cell
hatefulcrawdad
274
21k
How to build a perfect <img>
jonoalderson
1
5.2k
From Legacy to Launchpad: Building Startup-Ready Communities
dugsong
0
170
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