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
Namespace, What and Why
tagomoris
3
600
Fast JSX: Don't clone props object #28768
yossydev
1
230
Documentation testsの恩恵 / Documentation testing benefits
ssssota
1
540
ServerAction で Progressive Enhancement はどこまで頑張れるか? / progressive-enhancement-with-server-action
takefumiyoshii
6
510
Next.js App Router
quramy
14
2.3k
GitHub Actionsの痒いところを埋めるサードパーティーランナー
dora1998
1
180
Go製Webアプリケーションのエラーとの向き合い方大全、あるいはやっぱりスタックトレース欲しいやん / Kyoto.go #50
utgwkk
6
2k
Embedding it into Ruby code
soutaro
0
100
TypeScript 関数型スタイルでバックエンド開発のリアル
naoya
49
16k
障害対応を起点としたもっといい開発と運用のサイクル作りのためにできること / Hatena Enginner Seminar #29
polamjag
0
470
GNU Makeの使い方 / How to use GNU Make
kaityo256
PRO
12
4.3k
Prepare for Jakarta EE 11 - Performance and Developer Productivity
ivargrimstad
0
120
Featured
See All Featured
Large-scale JavaScript Application Architecture
addyosmani
504
110k
Into the Great Unknown - MozCon
thekraken
15
1.1k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
501
140k
Why Our Code Smells
bkeepers
PRO
331
56k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
26
2.3k
Navigating Team Friction
lara
179
13k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
8
3.5k
The Invisible Side of Design
smashingmag
294
49k
Ruby is Unlike a Banana
tanoku
96
10k
RailsConf 2023
tenderlove
9
580
Dealing with People You Can't Stand - Big Design 2015
cassininazir
358
22k
Building Your Own Lightsaber
phodgson
100
5.7k
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