Upgrade to PRO for Only $50/Year—Limited-Time Offer! 🔥
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
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
11
Dependency Management for Java - Portland - 2025-11-04
sullis
0
12
Dependency management for Java applications 2025-09-11
sullis
0
20
S3 NYC Iceberg meetup 2025-07-10
sullis
0
46
Amazon S3 Chicago 2025-06-04
sullis
0
110
Amazon S3 Boston 2025-05-07
sullis
0
74
Netty ConFoo Montreal 2025-02-27
sullis
0
120
GitHub Actions ConFoo Montreal 2025-02-26
sullis
0
80
Netty Portland Java User Group 2025-02-18
sullis
0
21
Other Decks in Programming
See All in Programming
JETLS.jl ─ A New Language Server for Julia
abap34
1
390
WebRTC と Rust と8K 60fps
tnoho
2
2k
C-Shared Buildで突破するAI Agent バックテストの壁
po3rin
0
390
FluorTracer / RayTracingCamp11
kugimasa
0
230
tparseでgo testの出力を見やすくする
utgwkk
2
210
Building AI Agents with TypeScript #TSKaigiHokuriku
izumin5210
6
1.3k
手が足りない!兼業データエンジニアに必要だったアーキテクチャと立ち回り
zinkosuke
0
660
Socio-Technical Evolution: Growing an Architecture and Its Organization for Fast Flow
cer
PRO
0
330
AIコーディングエージェント(Manus)
kondai24
0
170
Navigation 3: 적응형 UI를 위한 앱 탐색
fornewid
1
320
なあ兄弟、 余白の意味を考えてから UI実装してくれ!
ktcryomm
11
11k
AIコーディングエージェント(skywork)
kondai24
0
160
Featured
See All Featured
How GitHub (no longer) Works
holman
316
140k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
16k
Stop Working from a Prison Cell
hatefulcrawdad
273
21k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
35
2.3k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
7.9k
Designing for Performance
lara
610
69k
Building Better People: How to give real-time feedback that sticks.
wjessup
370
20k
Speed Design
sergeychernyshev
33
1.4k
The Pragmatic Product Professional
lauravandoore
37
7.1k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
359
30k
Bash Introduction
62gerente
615
210k
Automating Front-end Workflow
addyosmani
1371
200k
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