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
240
Java 21 - Portland Java User Group 2023-10-24
sullis
0
230
Code generation on the Java VM 2022-04-19
sullis
0
83
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
戦略的DDDは重いのか? / Is strategic DDD heavy?
pictiny
3
2k
Balkan Ruby 2024 — How and why to run SQLite on Rails in production
fractaledmind
0
110
freeeのエンジニアが 就活で出そうな コーディングテストを 解説してみる
freee
0
140
TypeScriptで使いやすいOpenAPIの書き方
yukimochi_dwango
0
410
ServerAction で Progressive Enhancement はどこまで頑張れるか? / progressive-enhancement-with-server-action
takefumiyoshii
6
510
How to improve maintainability and readability of your automated tests? ( #scrumniigata )
teyamagu
PRO
1
120
Direct Style Effect Systems The Print[A] ExampleA Comprehension Aid
philipschwarz
PRO
0
400
Kotlin Multiplatform at Stable and Beyond (Android Makers 2024)
zsmb
0
600
slow types ってなんだろう?
karad
0
210
An adventure of Happy Eyeballs
coe401_
1
130
Adding Security to Microcontroller Ruby
sylph01
0
140
Documentation testsの恩恵 / Documentation testing benefits
ssssota
1
540
Featured
See All Featured
Designing Dashboards & Data Visualisations in Web Apps
destraynor
226
51k
Happy Clients
brianwarren
92
6.4k
Intergalactic Javascript Robots from Outer Space
tanoku
266
26k
What's new in Ruby 2.0
geeforr
338
31k
A designer walks into a library…
pauljervisheath
201
23k
Building a Modern Day E-commerce SEO Strategy
aleyda
22
6.5k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
21
2k
The MySQL Ecosystem @ GitHub 2015
samlambert
244
12k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
8
3.5k
10 Git Anti Patterns You Should be Aware of
lemiorhan
649
58k
The Invisible Customer
myddelton
114
12k
The Invisible Side of Design
smashingmag
294
49k
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