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
130
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
Amazon S3 NYJavaSIG 2024-12-12
sullis
0
130
Amazon S3 - Portland Java User Group 2024-09-17
sullis
0
67
Netty - Montreal Java User Group 2024-05-21
sullis
0
150
Netty Chicago Java User Group 2024-04-17
sullis
0
980
Java 21 - Portland Java User Group 2023-10-24
sullis
0
300
Code generation on the Java VM 2022-04-19
sullis
0
120
Mockito 2022-01-25
sullis
0
170
GitHub Actions 2021-12-16
sullis
0
38
Apache Struts and the Equifax data breach 2021-06-03
sullis
0
55
Other Decks in Programming
See All in Programming
2024年のkintone API振り返りと2025年 / kintone API look back in 2024
tasshi
0
170
[JAWS-UG横浜 #79] re:Invent 2024 の DB アップデートは Multi-Region!
maroon1st
0
130
CNCF Project の作者が考えている OSS の運営
utam0k
5
620
[Fin-JAWS 第38回 ~re:Invent 2024 金融re:Cap~]FaultInjectionServiceアップデート@pre:Invent2024
shintaro_fukatsu
0
340
Immutable ActiveRecord
megane42
0
120
ISUCON14感想戦で85万点まで頑張ってみた
ponyo877
1
790
Spring gRPC について / About Spring gRPC
mackey0225
0
170
ASP.NET Core の OpenAPIサポート
h455h1
0
160
ペアーズでの、Langfuseを中心とした評価ドリブンなリリースサイクルのご紹介
fukubaka0825
1
200
HTML/CSS超絶浅い説明
yuki0329
0
210
Compose でデザインと実装の差異を減らすための取り組み
oidy
1
240
Java Webフレームワークの現状 / java web framework at burikaigi
kishida
9
2k
Featured
See All Featured
Embracing the Ebb and Flow
colly
84
4.5k
Fantastic passwords and where to find them - at NoRuKo
philnash
50
3k
Testing 201, or: Great Expectations
jmmastey
41
7.2k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
3.7k
The Illustrated Children's Guide to Kubernetes
chrisshort
48
49k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
45
2.3k
How GitHub (no longer) Works
holman
312
140k
Writing Fast Ruby
sferik
628
61k
YesSQL, Process and Tooling at Scale
rocio
171
14k
Speed Design
sergeychernyshev
25
760
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
192
16k
Building Applications with DynamoDB
mza
93
6.2k
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