Just in time Compilation Isn’t Magic
summary
Just-in-time compilation is explained with concrete thresholds and effects: warm runs go ~35,000 ns then C1 after ~70 iterations gives ~16,000 ns and a later C2 after ~15,000 invocations or 100,000 loop iterations hits ~5,500 ns; a stray global variable prevents dead-code elimination and turns a real workload into zero-time benchmarking. Tools named: javap, Java Flight Recorder, Java Microbenchmark Harness, JITWatch. Key techniques: intrinsics (~100), SSA and global value numbering, aggressive inlining (up to nine calls deep) that creates the real optimization opportunities.
AI-written summary · about
chapters (16)
- 0:00Introduction
- 1:26Magic vs optimizing compilers
- 4:37What JIT compiles
- 11:03Constant folding basics
- 14:58Pattern matching limits
- 16:46Composing optimizations
- 19:12Constant propagation
- 21:23Intrinsics magic
- 24:40Code elimination
- 27:29Loop optimizations
- 32:10Static single assignment
- 38:58Volatile and synchronized
- 43:17Interprocedural optimization
- 48:00Optimization is hard
- 50:08Tools and measuring
- 50:32Q&A
