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
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
Dependency Management for Java - Code Remix Summit 2026-05-12
sullis
0
49
AI Assisted Software Development - Portland Java User Group - 2026-04-14
sullis
0
51
Dependency Management for Java - Seattle 2025-11-18
sullis
0
46
Dependency Management for Java - Portland - 2025-11-04
sullis
0
32
Dependency management for Java applications 2025-09-11
sullis
0
48
S3 NYC Iceberg meetup 2025-07-10
sullis
0
58
Amazon S3 Chicago 2025-06-04
sullis
0
140
Amazon S3 Boston 2025-05-07
sullis
0
110
Netty ConFoo Montreal 2025-02-27
sullis
0
170
Other Decks in Programming
See All in Programming
tsserverとは何だったのか_これからどうなるのか
nowaki28
1
310
TSKaigi2026-静的解析への投資がAI時代のコード品質を支える ── カスタムESLintルールの設計と運用
hayatokudou
5
900
プロパティの順序で型推論が壊れる!? TypeScript6.0の修正からContext-Sensitivityの仕組みを追う
bicstone
2
810
Swiftのレキシカルスコープ管理
kntkymt
0
180
Stage 3 Decorators でできること / できないこと / TSKaigi 2026
susisu
1
410
Migrations : C'est une question d'hygiène !
vinceamstoutz
0
880
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
160
密結合なバックエンドから TypeScript のコードを生成する
kemuridama
1
300
リセットCSSを1行消したらアクセシビリティが向上した話
pvcresin
4
530
運用エージェントは "作る" から "育てる" へ - 記憶と自己進化の3層設計パターン / self-evolving-agents-three-layer-agent-design
gawa
8
520
UaaL×Androidアプリのメモリ計測 — Memory Profilerの先へ
rio432
0
170
My daily life on Ruby
a_matsuda
3
430
Featured
See All Featured
Ten Tips & Tricks for a 🌱 transition
stuffmc
0
110
Marketing to machines
jonoalderson
1
5.3k
Unsuck your backbone
ammeep
672
58k
HDC tutorial
michielstock
2
670
Context Engineering - Making Every Token Count
addyosmani
9
900
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.7k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
12
1.1k
The Straight Up "How To Draw Better" Workshop
denniskardys
239
140k
Ethics towards AI in product and experience design
skipperchong
2
280
Building an army of robots
kneath
306
46k
The AI Revolution Will Not Be Monopolized: How open-source beats economies of scale, even for LLMs
inesmontani
PRO
3
3.5k
Building Experiences: Design Systems, User Experience, and Full Site Editing
marktimemedia
0
510
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