What Lies Beneath
summary
Walks a tiny Java program from source through bytecode to x86 machine code and CPU caches, showing concrete effects: use javap -v to inspect the constant pool and bytecodes, use -XX:PrintInterpreter to see the template interpreter’s IDIV special-case checks (divide-by-zero and INT_MIN / -1), and use JMH to avoid dead-code elimination—a broken hand benchmark reports 0.25 ns/op (faster than a 0.3 ns clock) because JIT inlines, constant-folds and deletes work, while a linked-list vs primitive-array test exposes huge cache-miss penalties and prefetch behavior.
AI-written summary · about
chapters (20)
- 0:00Intro
- 1:25Dmitry Vyazelenko
- 2:37What Lies Beneath
- 10:17Executing
- 13:45java ... -XX: +PrintInterpreter
- 17:21Improving Our Program...?
- 18:24How Not to Benchmark
- 20:42Let's Benchmark!
- 22:03Manual Optimisation
- 24:05Without Inlining (-XX:-Inline)
- 26:02With Inlining
- 28:30JIT Optimisations
- 30:57But Processors Got Better...
- 32:30Bridging the Gap
- 34:08The Memory Hierarchy
- 36:37Measuring Cache-Friendliness
- 42:40Primitive Array
- 43:40Poor Unloved Linkedlist...
- 45:27Conclusions From javac soup to hardware nuts, there's a lot of advanced technology here. And as everyone knows to the ignorant
- 46:20Digging Deeper...
related talks
54mWhat Lies Beneath
41mWhat Lies Beneath
44mJIT Me Baby One More Time
53mWell there's your problem! Your engine's missing! A look under Java's hood
01h 07mFrom Java to Assembly: Down the Rabbit Hole
34mWhat happens to your code when you don't look?
32mUnveiling the Hidden Layers of Java Class Files Beyond Bytecode
38mGraal
