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
12年前の『型システム入門』翻訳の思い出話
mame
11
1.2k
GraphQL はいいぞ! ~Laravel で学ぶ GraphQL 入門~
azuki
1
160
CSC307 Lecture 06
javiergs
PRO
0
360
みんなのオブザーバビリティプラットフォームを作ってるんだがパフォーマンスがやばい #mackerelio #srenext
ne_sachirou
0
380
AHC035解説
terryu16
0
730
Folding Cheat Sheet #7
philipschwarz
PRO
0
150
【Go言語】golangci-lintの使い方
tomo1227
0
280
なぜ宣言的 UI は壊れにくいのか / Why declarative UI is less fragile
uenitty
29
13k
日付と正規化
megmogmog1965
0
140
スクラムマスターって孤独じゃないですか?
yoshitaroyoyo
1
140
しくじり先生 Image Matching Challenge 2024 編
goosehaaan
0
810
feature環境をGitHub ActionsとCloudFormationでいい感じに管理する
nealle
2
310
Featured
See All Featured
Web Components: a chance to create the future
zenorocha
307
41k
Building Your Own Lightsaber
phodgson
101
5.9k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
78
15k
Raft: Consensus for Rubyists
vanstee
134
6.5k
5 minutes of I Can Smell Your CMS
philhawksworth
200
19k
Testing 201, or: Great Expectations
jmmastey
33
6.9k
Producing Creativity
orderedlist
PRO
340
39k
The Cost Of JavaScript in 2023
addyosmani
31
4.7k
The World Runs on Bad Software
bkeepers
PRO
63
11k
How to Think Like a Performance Engineer
csswizardry
4
590
Building an army of robots
kneath
301
42k
VelocityConf: Rendering Performance Case Studies
addyosmani
321
23k
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