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
100
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 Chicago Java User Group 2024-04-17
sullis
0
250
Java 21 - Portland Java User Group 2023-10-24
sullis
0
230
Code generation on the Java VM 2022-04-19
sullis
0
84
Mockito 2022-01-25
sullis
0
150
GitHub Actions 2021-12-16
sullis
0
28
Apache Struts and the Equifax data breach 2021-06-03
sullis
0
46
Guardrail State of the Union 2021-04-13
sullis
0
280
Guardrail: State of the Union 2021-03-18
sullis
0
140
Java on AWS 2020-12-15
sullis
0
200
Other Decks in Programming
See All in Programming
HonoのRPCで真の型安全が欲しかった
kosei28
1
170
TypeScriptのパフォーマンス改善
yajihum
14
5.2k
FoodGram
iseruuuuu
0
230
Docker_OSS_ホスティング入門
satokoki645
0
140
Upgrading Legacy to the Latest PHP Version
afilina
PRO
0
100
Try creating your own orderedmap
kazamori
1
290
The Design of Everyday APIs - PyCon 2024
roguelynn
1
240
RustでAWS Lambda functionをいい感じに書く
taiki45
2
160
Embedding it into Ruby code
soutaro
2
450
仕様と実装で学ぶOpenTelemetry
drumato
2
1.2k
Escolhendo (ou não) o melhor ORM para o seu projeto
andreiacsilva
1
170
The Hotwire Landscape After Turbo 8 @ Helvetic Ruby 2024, Zurich
marcoroth
0
100
Featured
See All Featured
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
14
1.5k
No one is an island. Learnings from fostering a developers community.
thoeni
16
2.1k
Learning to Love Humans: Emotional Interface Design
aarron
268
39k
Why Our Code Smells
bkeepers
PRO
331
56k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
117
18k
Building Adaptive Systems
keathley
32
1.9k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
221
21k
Infographics Made Easy
chrislema
238
18k
How STYLIGHT went responsive
nonsquared
92
4.9k
The Straight Up "How To Draw Better" Workshop
denniskardys
228
130k
A Tale of Four Properties
chriscoyier
153
22k
Writing Fast Ruby
sferik
622
60k
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