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
160
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
Dependency Management for Java - Portland - 2025-11-04
sullis
0
10
Dependency management for Java applications 2025-09-11
sullis
0
17
S3 NYC Iceberg meetup 2025-07-10
sullis
0
44
Amazon S3 Chicago 2025-06-04
sullis
0
110
Amazon S3 Boston 2025-05-07
sullis
0
64
Netty ConFoo Montreal 2025-02-27
sullis
0
110
GitHub Actions ConFoo Montreal 2025-02-26
sullis
0
77
Netty Portland Java User Group 2025-02-18
sullis
0
19
Amazon S3 NYJavaSIG 2024-12-12
sullis
0
200
Other Decks in Programming
See All in Programming
Snowflake リリースに注意を払いたくなる話
masaaya
0
100
CSC509 Lecture 11
javiergs
PRO
0
300
Atomics APIを知る / Understanding Atomics API
ssssota
1
120
What's New in Web AI?
christianliebel
PRO
0
120
しっかり学ぶ java.lang.*
nagise
0
160
Amazon Bedrock Knowledge Bases Hands-on
konny0311
0
140
AI POSにおけるLLM Observability基盤の導入 ― サイバーエージェントDXインターン成果報告
hekuchan
0
480
ボトムアップの生成AI活用を推進する社内AIエージェント開発
aku11i
0
1.6k
JJUG CCC 2025 Fall: Virtual Thread Deep Dive
ternbusty
3
140
なぜ強調表示できず ** が表示されるのか — Perlで始まったMarkdownの歴史と日本語文書における課題
kwahiro
9
5.2k
業務でAIを使いたい話
hnw
0
260
Core MIDI を勉強して作曲用の電子ピアノ作ってみた!
hypebeans
0
100
Featured
See All Featured
Mobile First: as difficult as doing things right
swwweet
225
10k
GraphQLの誤解/rethinking-graphql
sonatard
73
11k
Writing Fast Ruby
sferik
630
62k
How Fast Is Fast Enough? [PerfNow 2025]
tammyeverts
3
320
GraphQLとの向き合い方2022年版
quramy
49
14k
Making Projects Easy
brettharned
120
6.4k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
46
7.8k
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.3k
Speed Design
sergeychernyshev
32
1.2k
Facilitating Awesome Meetings
lara
57
6.6k
Git: the NoSQL Database
bkeepers
PRO
432
66k
Being A Developer After 40
akosma
91
590k
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