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
140
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 ConFoo Montreal 2025-02-27
sullis
0
39
GitHub Actions ConFoo Montreal 2025-02-26
sullis
0
23
Netty Portland Java User Group 2025-02-18
sullis
0
4
Amazon S3 NYJavaSIG 2024-12-12
sullis
0
140
Amazon S3 - Portland Java User Group 2024-09-17
sullis
0
74
Netty - Montreal Java User Group 2024-05-21
sullis
0
160
Netty Chicago Java User Group 2024-04-17
sullis
0
1k
Java 21 - Portland Java User Group 2023-10-24
sullis
0
300
Code generation on the Java VM 2022-04-19
sullis
0
120
Other Decks in Programming
See All in Programming
CIBMTR振り返り+敗北から学ぶコンペの取り組み方反省
takanao
1
500
新卒から4年間、20年もののWebサービスと 向き合って学んだソフトウェア考古学
oguri
7
6.3k
CTFのWebにおける⾼難易度問題について
hamayanhamayan
1
890
RubyKaigiで手に入れた HHKB Studioのための HIDRawドライバ
iberianpig
0
110
Devinのメモリ活用の学びを自社サービスにどう組み込むか?
itarutomy
0
700
アーキテクトと美学 / Architecture and Aesthetics
nrslib
11
2.8k
OUPC2024 Day 1 解説
kowerkoint
0
380
Denoでフロントエンド開発 2025年春版 / Frontend Development with Deno (Spring 2025)
petamoriken
1
1.2k
なぜselectはselectではないのか
taiyow
2
260
AWS CDKにおけるL2 Constructの仕組み / aws-cdk-l2-construct
gotok365
4
910
S3静的ホスティング+Next.js静的エクスポート で格安webアプリ構築
iharuoru
0
160
AtCoder Heuristic First-step Vol.1 講義スライド
terryu16
2
760
Featured
See All Featured
The Cult of Friendly URLs
andyhume
78
6.3k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
33
2.1k
Adopting Sorbet at Scale
ufuk
75
9.3k
Art, The Web, and Tiny UX
lynnandtonic
298
20k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
28
2k
Fontdeck: Realign not Redesign
paulrobertlloyd
83
5.4k
GraphQLの誤解/rethinking-graphql
sonatard
69
10k
A Modern Web Designer's Workflow
chriscoyier
693
190k
Building Your Own Lightsaber
phodgson
104
6.3k
Building a Scalable Design System with Sketch
lauravandoore
462
33k
How STYLIGHT went responsive
nonsquared
99
5.4k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
280
13k
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