Profilers Are Lying Hobbitses
summary
Claim: common Java profilers mislead because of sampling mechanics and JIT transformations. VisualVM-style profilers show safepoint bias that pins samples to arbitrary loop entry lines; Mission Control (JFR) uses JFR cycles-based sampling and can hide missed samples and native work; async/async-profiler exposes native and GC cost (example: GC taking ~50% of samples), while instruction-level profiles misplace blame near expensive ops like division and suffer from inlining and compiled-version mixing. Use multiple profilers, enable debug info, check sample counts and per-thread breakdowns before optimizing.
AI-written summary · about
chapters (11)
- 0:00Introduction to profilers
- 2:15How sampling profilers work
- 5:26Safepoint bias in profilers
- 11:28Java Mission Control overview
- 18:14Flame graphs and JFR comparison
- 24:37Instruction-level profiling
- 32:10Accuracy of instruction profilers
- 37:33Mapping assembly to code
- 41:08Inlining and profiling issues
- 45:51Thread utilization in profiles
- 48:27Using profilers effectively
related talks
23mDon’t Trust Your Profiler: An Empirical Study on the Precision and Accuracy of Ja...
50mJPoint 2023 TechRadar: Performance Tools
33mWriting a Java Profiler in Pure Java
41mUnleash the Power of Open-Source Java Profilers
39mFive most useful profiling techniques to use with modern Java apps
42mOff-CPU Profiling & Latency Diagnostics in Java
46mJava Deep Dive - the ins and outs of profiling
42mWrite your own Java Profiler in 240 lines of pure Java
