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
130
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
Amazon S3 NYJavaSIG 2024-12-12
sullis
0
140
Amazon S3 - Portland Java User Group 2024-09-17
sullis
0
70
Netty - Montreal Java User Group 2024-05-21
sullis
0
160
Netty Chicago Java User Group 2024-04-17
sullis
0
990
Java 21 - Portland Java User Group 2023-10-24
sullis
0
300
Code generation on the Java VM 2022-04-19
sullis
0
120
Mockito 2022-01-25
sullis
0
170
GitHub Actions 2021-12-16
sullis
0
41
Apache Struts and the Equifax data breach 2021-06-03
sullis
0
55
Other Decks in Programming
See All in Programming
Amazon Q Developer Proで効率化するAPI開発入門
seike460
PRO
0
110
苦しいTiDBへの移行を乗り越えて快適な運用を目指す
leveragestech
0
580
一休.com のログイン体験を支える技術 〜Web Components x Vue.js 活用事例と最適化について〜
atsumim
0
470
昭和の職場からアジャイルの世界へ
kumagoro95
1
380
Software Architecture
hschwentner
6
2.1k
バックエンドのためのアプリ内課金入門 (サブスク編)
qnighy
8
1.8k
JavaScriptツール群「UnJS」を5分で一気に駆け巡る!
k1tikurisu
9
1.8k
Grafana Cloudとソラカメ
devoc
0
170
Kubernetes History Inspector(KHI)を触ってみた
bells17
0
230
Formの複雑さに立ち向かう
bmthd
1
850
2024年のkintone API振り返りと2025年 / kintone API look back in 2024
tasshi
0
220
法律の脱レガシーに学ぶフロントエンド刷新
oguemon
5
740
Featured
See All Featured
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
27
1.9k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
133
33k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
356
29k
Scaling GitHub
holman
459
140k
Bootstrapping a Software Product
garrettdimon
PRO
306
110k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
233
17k
What's in a price? How to price your products and services
michaelherold
244
12k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
6
550
Rails Girls Zürich Keynote
gr2m
94
13k
Intergalactic Javascript Robots from Outer Space
tanoku
270
27k
A better future with KSS
kneath
238
17k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
226
22k
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