What Lies Beneath
summary
Tiny Java program is traced from source to bytecode to machine code and hardware; the template interpreter emits extra checks around integer division (special-case INT_MIN / -1) with assembly like XORing edx and register juggling, adding measurable overhead. Manual inlining helps a little, the JIT with inlining gives a huge win (score 178 → 3). Benchmarks use JMH plus perf and hsdis. A linked list shows ~4x slowdown vs primitive array because of one L1 cache miss per op and long memory-latency chains. Project Valhalla/value objects aim to fix this.
AI-written summary · about
chapters (34)
- 0:00Intro
- 1:28Introduction Slide
- 1:43Unconferences
- 2:50Interaction Mechanism
- 3:05What Lies Beneath
- 4:05The Basics
- 5:01The Program
- 7:00The bytecode
- 13:49Template Interpreter
- 22:13Benchmark
- 22:52Improved code
- 23:17Profiler
- 24:46Inline
- 25:23Division
- 26:11Add
- 26:55Performance Difference
- 27:53Optimizations
- 28:22Running on Hardware
- 29:02Pooh Emoji
- 29:27Algorithmic Complexity
- 31:34Modern Machines
- 32:17Moores Law
- 33:50Memory Hierarchy
- 36:21Stride Prefetching
- 37:01Stripe Prefetching
- 37:53ObjectOriented Programming
- 39:32Arrays
- 40:05Translation Buffer
- 41:09Cache Friendly
- 41:24JMH
- 42:44Linked Lists
- 43:38Cache Misses
- 44:22Cache Levels
- 46:34Conclusions








