Java Benchmarking: How to Read Two Timestamps!
summary
The talk explains common pitfalls in measuring Java performance and how naive timing (two System.nanoTime() calls) can mislead. It presents methods to obtain meaningful benchmark data and focuses on using Java Microbenchmark Harness (JMH) from OpenJDK as the standard tool for writing and analyzing Java microbenchmarks.
AI-written summary · about
chapters (31)
- 0:00Introduction
- 1:11Benchmarking purposes
- 4:25Engineering approach
- 6:54Benchmarking pitfalls
- 7:38String creation cost
- 9:22Realistic benchmarks
- 10:24Baseline selection
- 13:55Baselines not absolute
- 14:36Performance models
- 16:02Direct measurement fails
- 17:28Timestamp latency
- 19:13Timestamp behavior
- 20:17Scaling and interference
- 21:46Beyond timestamp limits
- 24:17Monotonic time challenges
- 26:44Partial code sections
- 28:11Thread contention errors
- 31:07Fibonacci flaws
- 34:00Transient processes
- 35:02Comparable design
- 36:50Tail recursion myth
- 38:56Profiling limits
- 41:29Assembly and counters
- 42:14Integer division
- 44:56JVM pitfalls
- 46:28Interpreting results
- 47:34Reality vs models
- 47:56Conclusion
- 51:59Q&A: Simple checks
- 53:55Q&A: Validating correctness
- 56:31Q&A: Cross-system differences
