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
42
GitHub Actions ConFoo Montreal 2025-02-26
sullis
0
23
Netty Portland Java User Group 2025-02-18
sullis
0
5
Amazon S3 NYJavaSIG 2024-12-12
sullis
0
140
Amazon S3 - Portland Java User Group 2024-09-17
sullis
0
76
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
アーキテクトと美学 / Architecture and Aesthetics
nrslib
12
2.9k
NestJSのコードからOpenAPIを自動生成する際の最適解を探す
astatsuya
0
160
AtCoder Heuristic First-step Vol.1 講義スライド
terryu16
2
950
requirements with math
moony
0
500
読もう! Android build ドキュメント
andpad
1
190
PHPUnit 高速化テクニック / PHPUnit Speedup Techniques
pinkumohikan
1
790
令和トラベルにおけるコンテンツ生成AIアプリケーション開発の実践
ippo012
1
250
WordPress Playground for Developers
iambherulal
0
120
AIエージェントを活用したアプリ開発手法の模索
kumamotone
1
730
PHPによる"非"構造化プログラミング入門 -本当に熱いスパゲティコードを求めて- #phperkaigi
o0h
PRO
0
880
Devin , 正しい付き合い方と使い方 / Living and Working with Devin
yukinagae
1
500
バックエンドNode.js × フロントエンドDeno で開発して得られた知見
ayame113
4
1.2k
Featured
See All Featured
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
32
2.2k
Designing for humans not robots
tammielis
250
25k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
14
1.1k
KATA
mclloyd
29
14k
Imperfection Machines: The Place of Print at Facebook
scottboms
267
13k
Statistics for Hackers
jakevdp
797
220k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
356
30k
What's in a price? How to price your products and services
michaelherold
244
12k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
31
4.7k
Code Reviewing Like a Champion
maltzj
521
39k
Raft: Consensus for Rubyists
vanstee
137
6.8k
Rebuilding a faster, lazier Slack
samanthasiow
80
8.9k
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