JavaScriptCore (JSC) vs V8 Architecture: FTL JIT, Tiering, and Memory Footprint
- Last updated
- Prerequisites:
- V8 Engine architecture (Ignition/TurboFan)
- JIT compilation basics
- bun
- javascriptcore
- v8
- jit
- engine
- performance
- memory
Read at your depth
The practical view
Bun uses WebKit's JavaScriptCore (JSC) instead of Google's V8 (used by Node.js and Deno). JSC features a 4-tier JIT compilation pipeline: LLInt (Low-Level Interpreter), Baseline JIT, DFG (Data Flow Graph) JIT, and FTL (Faster Than Light) JIT. This multi-tiered approach prioritizes fast startup time and low memory consumption.
The same idea in other frameworks
Node.js running on V8 (Ignition interpreter + TurboFan JIT).Deno running on V8 with Rust/Tokio bindings.Bun running on WebKit JavaScriptCore (LLInt + DFG + FTL JIT) with Zig bindings.Safari running JavaScriptCore; Chrome running V8; Firefox running SpiderMonkey.Legacy vs modern
Cold Boot Memory & Execution Latency
JSC in Bun boots in single-digit milliseconds with low memory; V8 in Node requires more initial allocation.
node script.js // ~30-50ms startup time, ~30MB base RSS memorybun script.js // ~3-5ms startup time, ~10MB base RSS memoryInterview gotchas
Context
Interviewers test your knowledge of runtime design trade-offs.
The mechanical answer
JSC was chosen for three primary reasons: (1) **Faster startup time**: JSC's LLInt interpreter starts executing code in single-digit milliseconds, critical for CLI tools and serverless cold starts. (2) **Lower memory usage**: JSC's compact structure tables and generational collector use 2-3x less base memory than V8. (3) **C/C++ API ergonomics**: JSC has clean C API bindings that made integration with Zig straightforward.
Trap
Do not claim that JSC has higher peak arithmetic throughput in all workloads; V8's TurboFan can match or outperform FTL in long-running continuous benchmarks, but JSC wins on startup and memory.
Context
Checks deep engine-level compiler knowledge.
The mechanical answer
**B3 (Bare Bones Backend)** is the custom backend optimizing compiler used by JSC's FTL (Faster Than Light) JIT tier. It replaced LLVM to provide extremely fast compilation times while generating machine code nearly identical in quality to LLVM for hot JavaScript functions.
Trap
B3 is part of JavaScriptCore, not a third-party C library.