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
120
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
Netty - Montreal Java User Group 2024-05-21
sullis
0
99
Netty Chicago Java User Group 2024-04-17
sullis
0
470
Java 21 - Portland Java User Group 2023-10-24
sullis
0
250
Code generation on the Java VM 2022-04-19
sullis
0
90
Mockito 2022-01-25
sullis
0
160
GitHub Actions 2021-12-16
sullis
0
33
Apache Struts and the Equifax data breach 2021-06-03
sullis
0
48
Guardrail State of the Union 2021-04-13
sullis
0
300
Guardrail: State of the Union 2021-03-18
sullis
0
150
Other Decks in Programming
See All in Programming
Advanced App Shrinking Techniques
cbeyls
2
150
AWSでゲームサーバーを運用! Amazon GameLiftのお話
iriikeita
0
200
CSC307 Lecture 10
javiergs
PRO
0
310
大規模マルチテナントを解決するYugabyteDBという選択肢
nnaka2992
1
250
DMMプラットフォームにおけるTiDBの導入から運用まで
pospome
7
3k
The rollercoaster of releasing an Android, iOS, and macOS app with Kotlin Multiplatform | droidcon Berlin
prof18
0
110
HMSコンペ 11th Solution (team : kansai-kaggler)
t88
1
680
12年前の『型システム入門』翻訳の思い出話
mame
11
1.2k
DDDを志して3年経ったら「DDDの皮を被ったクリーンアーキテクチャ」になった話【デブサミ2024夏】
texmeijin
1
620
Namespace on read
tagomoris
2
370
Webエディタライブラリ 「CodeMirror」から学ぶ Webアプリ開発のテクニック
ryosukeigarashi
0
250
Trial
cairolibrary720
1
130
Featured
See All Featured
In The Pink: A Labor of Love
frogandcode
139
22k
Agile that works and the tools we love
rasmusluckow
325
20k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
13
430
5 minutes of I Can Smell Your CMS
philhawksworth
200
19k
Intergalactic Javascript Robots from Outer Space
tanoku
266
26k
Making the Leap to Tech Lead
cromwellryan
127
8.7k
Speed Design
sergeychernyshev
9
270
Thoughts on Productivity
jonyablonski
64
4.1k
Statistics for Hackers
jakevdp
792
220k
Happy Clients
brianwarren
94
6.5k
The Invisible Customer
myddelton
117
13k
The Invisible Side of Design
smashingmag
294
50k
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