Orinoco and Maglev are two major components in the modern V8 pipeline that address different performance aspects: Orinoco is the garbage collector responsible for memory management, while Maglev is a mid-tier optimizing compiler that generates optimized code faster than TurboFan for moderately hot functions.
The V8 pipeline has evolved significantly from a simple interpreter+optimizing compiler model to a multi-tier system with multiple execution and memory management components. Orinoco and Maglev serve completely different but complementary roles: Orinoco manages memory by collecting garbage with minimal main thread pauses, while Maglev generates optimized machine code for functions that are hot enough to benefit from optimization but not hot enough to justify TurboFan's more aggressive (and slower) compilation .
Ignition: Fast interpreter that generates and executes bytecode, collecting type feedback via inline caches .
Sparkplug: Baseline JIT compiler that generates machine code almost instantaneously from bytecode, providing a quick performance boost with minimal compilation time .
Maglev: Mid-tier optimizing compiler (introduced in Chrome 117) that generates good quality code much faster than TurboFan, filling the gap between Sparkplug and TurboFan .
TurboFan: Top-tier optimizing compiler that generates the highest quality machine code using aggressive optimizations, but takes significantly longer to compile .
Orinoco: Garbage collector that manages memory across all tiers, using parallel, incremental, and concurrent techniques to minimize pause times .
The pipeline works as a progression: all code starts in Ignition (bytecode). As functions become hot, they're compiled by Sparkplug for a quick speedup. For functions that get even hotter, Maglev steps in to generate optimized code quickly. Only the hottest functions receive TurboFan's full optimization treatment. Throughout execution, Orinoco runs in the background managing memory across all tiers .
Maglev was introduced because there was a significant performance gap between Sparkplug and TurboFan. Sparkplug compiles extremely fast but produces relatively slow code, while TurboFan produces very fast code but compiles slowly. Maglev sits in the middle: it generates code about 20x slower than Sparkplug to compile, but 10-100x faster than TurboFan, while producing code that's significantly faster than Sparkplug's output . This improved Speedometer scores by 6% and JetStream by 8.2%, while reducing energy consumption by 10% .
Parallel Scavenging: For young generation collections, Orinoco uses multiple helper threads to evacuate live objects, reducing main thread pause time by 20-50% .
Concurrent Marking: Major GC (full heap collections) starts with concurrent marking in background threads while JavaScript continues executing on the main thread .
Parallel Compaction: During major GC, compaction work is distributed across threads, reducing compaction time by 75% (from ~7ms to under 2ms) .
Idle-Time GC: Orinoco can perform garbage collection during browser idle periods, further reducing jank .
Write Barriers: Used to track old-to-new references and maintain consistency during concurrent marking .
The key insight is that Orinoco and Maglev operate in parallel but serve different purposes. Maglev improves JavaScript execution speed by generating better code faster for moderately hot functions . Orinoco improves memory management by collecting garbage with minimal interruption to JavaScript execution . Together, they represent V8's continued investment in both execution performance and memory efficiency, with measurable results: 34% improvement in Speedometer scores in 2023 alone .
Both components are part of V8's ongoing evolution. Maglev was introduced in Chrome 117 and continues to be expanded . Orinoco has been incrementally shipping features since 2016, with parallel scavenging, concurrent marking, and parallel compaction all now standard . The trend is toward more parallelization, more concurrency, and better utilization of multi-core hardware to keep the main thread free for JavaScript execution .