JIT Compilers Explained
A JIT compiler watches your program run, then compiles the hot parts to native code while you're still running. This video explains the three phases every JIT goes through — interpreting, profiling, and optimizing — and the machinery underneath: how it emits machine code into executable memory, why it needs to guard its optimizations, and how it can deoptimize back to the interpreter when its assumptions break.
Topics covered:
- Why JITs start as interpreters and startup speed matters
- Profiling: counting executions and detecting "hot" loops and call sites
- Tiered compilation: baseline code first, optimized code later
- Emitting native code: the code cache and how machine code is generated at runtime
- Inlining: the JIT's most important optimization
- Guards, speculative optimization, and the deoptimization (bailout) path
- How V8, the JVM, and LuaJIT structure tiered pipelines
- The trade-off: compilation time vs. steady-state performance
Related articles
JIT Compilation: Why Hot Loops Become Machine Code
Tiered compilation, on-stack replacement, and deoptimization — when the runtime outperforms the ahead-of-time compiler.
Tail Call Optimization and Recursion: When the Stack Grows and When It Doesn't
How tail-position calls become jumps instead of calls, why C compilers only do it with optimization, why JavaScript engines tried and mostly stopped, and how trampolines fake TCO.
Boxing, Unboxing, and Value vs Reference Semantics
Why every boxed int is a heap allocation, why int[] beats ArrayList and Integer[] by 4-16x, how Java generics erasure forces boxing, and how C# structs avoid it.
More in Runtime & Execution
How Garbage Collection Actually Works
A visual walkthrough of mark-sweep, generational collection, and concurrent GC — the algorithms that keep your memory clean.
WatchWhat Your Code Does Before main()
The loader, the linker, the dynamic linker, and the runtime — everything that happens between pressing run and your first line of code.
WatchHow Threads Actually Work
The kernel scheduler, context switches, goroutines versus threads — a visual walkthrough of what 'running on a core' really means.
WatchAsync/Await Under the Hood
What async/await compiles to — state machines, continuations, and the executor — and how your async function actually runs on one or many threads.
DetailsVirtual Machines Explained
How language VMs like the JVM and the CLR work — bytecode verification, the execution engine, and the runtime services beneath your program.
DetailsInterpreters vs. Compilers
What an interpreter actually does at runtime versus what a compiler does before — ASTs, bytecode, and why the boundary keeps blurring.
DetailsReference Counting vs. Tracing GC
The two families of automatic memory management — refcounts, cycles, and ARC versus tracing collectors, roots, and reachability — compared on real trade-offs.
DetailsStack vs. Heap Memory
Where your variables actually live — the hardware stack's push and pop discipline versus the heap's malloc and free — and why the difference matters.
DetailsThe Event Loop, Visualized
How Node.js and the browser run one thread with many tasks — the call stack, the task queue, and microtasks — animated frame by frame.
DetailsDepth, delivered weekly
One technical dispatch a week — articles and episode notes before they go public.
One technical dispatch per week. No noise.