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
Dependency management for Java applications 2025-09-11
sullis
0
8
S3 NYC Iceberg meetup 2025-07-10
sullis
0
41
Amazon S3 Chicago 2025-06-04
sullis
0
100
Amazon S3 Boston 2025-05-07
sullis
0
55
Netty ConFoo Montreal 2025-02-27
sullis
0
100
GitHub Actions ConFoo Montreal 2025-02-26
sullis
0
63
Netty Portland Java User Group 2025-02-18
sullis
0
12
Amazon S3 NYJavaSIG 2024-12-12
sullis
0
190
Amazon S3 - Portland Java User Group 2024-09-17
sullis
0
110
Other Decks in Programming
See All in Programming
FindyにおけるTakumi活用と脆弱性管理のこれから
rvirus0817
0
530
詳解!defer panic recover のしくみ / Understanding defer, panic, and recover
convto
0
250
RDoc meets YARD
okuramasafumi
4
170
個人開発で徳島大学生60%以上の心を掴んだアプリ、そして手放した話
akidon0000
1
120
AIコーディングAgentとの向き合い方
eycjur
0
280
楽して成果を出すためのセルフリソース管理
clipnote
0
180
Compose Multiplatform × AI で作る、次世代アプリ開発支援ツールの設計と実装
thagikura
0
170
Updates on MLS on Ruby (and maybe more)
sylph01
1
180
CJK and Unicode From a PHP Committer
youkidearitai
PRO
0
110
チームのテスト力を鍛える
goyoki
3
800
Amazon RDS 向けに提供されている MCP Server と仕組みを調べてみた/jawsug-okayama-2025-aurora-mcp
takahashiikki
1
110
請來的 AI Agent 同事們在寫程式時,怎麼用 pytest 去除各種幻想與盲點
keitheis
0
120
Featured
See All Featured
The Power of CSS Pseudo Elements
geoffreycrofte
77
6k
Bootstrapping a Software Product
garrettdimon
PRO
307
110k
Large-scale JavaScript Application Architecture
addyosmani
513
110k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
1.6k
Code Review Best Practice
trishagee
71
19k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
23
1.4k
The Art of Programming - Codeland 2020
erikaheidi
56
13k
Bash Introduction
62gerente
615
210k
KATA
mclloyd
32
14k
GraphQLとの向き合い方2022年版
quramy
49
14k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
127
53k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
44
2.5k
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