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
0
150
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 applications 2025-09-11
sullis
0
13
S3 NYC Iceberg meetup 2025-07-10
sullis
0
43
Amazon S3 Chicago 2025-06-04
sullis
0
110
Amazon S3 Boston 2025-05-07
sullis
0
59
Netty ConFoo Montreal 2025-02-27
sullis
0
110
GitHub Actions ConFoo Montreal 2025-02-26
sullis
0
67
Netty Portland Java User Group 2025-02-18
sullis
0
14
Amazon S3 NYJavaSIG 2024-12-12
sullis
0
190
Amazon S3 - Portland Java User Group 2024-09-17
sullis
0
110
Other Decks in Programming
See All in Programming
階層構造を表現するデータ構造とリファクタリング 〜1年で10倍成長したプロダクトの変化と課題〜
yuhisatoxxx
3
960
Go言語の特性を活かした公式MCP SDKの設計
hond0413
1
210
NixOS + Kubernetesで構築する自宅サーバーのすべて
ichi_h3
0
440
CSC509 Lecture 05
javiergs
PRO
0
300
オープンソースソフトウェアへの解像度🔬
utam0k
11
2.2k
私達はmodernize packageに夢を見るか feat. go/analysis, go/ast / Go Conference 2025
kaorumuta
2
510
Pythonスレッドとは結局何なのか? CPython実装から見るNoGIL時代の変化
curekoshimizu
5
1.7k
Introducing ReActionView: A new ActionView-Compatible ERB Engine @ Kaigi on Rails 2025, Tokyo, Japan
marcoroth
3
970
Conquering Massive Traffic Spikes in Ruby Applications with Pitchfork
riseshia
0
160
Advance Your Career with Open Source
ivargrimstad
0
450
Cursorハンズオン実践!
eltociear
2
640
どの様にAIエージェントと 協業すべきだったのか?
takefumiyoshii
2
630
Featured
See All Featured
Gamification - CAS2011
davidbonilla
81
5.5k
The Pragmatic Product Professional
lauravandoore
36
6.9k
Embracing the Ebb and Flow
colly
88
4.8k
Context Engineering - Making Every Token Count
addyosmani
5
210
Intergalactic Javascript Robots from Outer Space
tanoku
273
27k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
657
61k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
23
1.5k
Build The Right Thing And Hit Your Dates
maggiecrowley
37
2.9k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.5k
The World Runs on Bad Software
bkeepers
PRO
71
11k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
29
2.7k
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