Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

V8 3 min read Announcement mediumAdept

Giving V8 a Heads-Up: Faster JavaScript Startup with Explicit Compile Hints

Chrome 136 ships Explicit Compile Hints, which let developers mark a JavaScript file for eager compilation by placing the magic comment `//# allFunctionsCalledOnLoad` at the top. Eager compilation avoids a duplicate lightweight-then-full parse and moves compile work onto a background thread interleaved with network loading, instead of blocking the main thread on first call. In V8's experiment, 17 of 20 popular pages improved, with an average 630 ms reduction in foreground parse and compile time. Apply it sparingly to a core file because over-compiling costs time and memory, and verify the effect with `--log-function_events`. Per-function hints are planned.

Assumes: JavaScript basicslazy vs eager compilation

Related posts

  • Bun v1.3.9

    Bun mediumAdept

    Bun v1.3.9 adds `bun run --parallel` and `--sequential` for running package.json scripts with prefixed output across workspaces, along with Node-compatible HTTP/2 connection upgrades via `net.Server`, `Symbol.dispose` support for test mocks, `NO_PROXY` handling for explicit proxies, `--cpu-prof-interval`, and ESM bytecode in `--compile`. A JavaScriptCore upgrade brings SIMD-accelerated RegExp prefix search on ARM64 and x86_64, JIT compilation of fixed-count parenthesized subpatterns (~3.9x faster), DFG/FTL intrinsics for `startsWith`, `Set/Map#size` (2.2-2.7x) and `trim`, and rope-returning `String#replace`. Fixes include SIGILL crashes on ARMv8.0 CPUs caused by mimalloc LSE atomics, a chunked-encoding request smuggling bug, and keep-alive hangs for proxy-style requests.

  • V8 release v6.9 · V8

    V8 easyNovice

    V8 v6.9 embeds built-in functions directly into the binary on x64, so all Isolates share one copy instead of each holding up to 700 KB on its own heap. Across the top 10k sites this cut median V8 heap size by 9%, and 10% of sites saved 3.7 MB or more. Liftoff, a new baseline WebAssembly compiler, speeds startup by over 10×. DataView methods were reimplemented in Torque and inlined by TurboFan to match TypedArray speed, and concurrent, incremental and parallel WeakMap processing roughly halves Mark-Compact GC pauses, with a linear-time fallback replacing worst cases that could take seconds. The release also adds Array.prototype.flat and flatMap.

  • Speculative Optimizations for WebAssembly using Deopts and Inlining

    V8 hardMaster

    V8 in Chrome M137 adds speculative call_indirect inlining and deoptimization support for WebAssembly, using runtime call-target feedback gathered by the Liftoff baseline compiler so TurboFan can inline up to four likely callees behind cheap instance and target checks. When an assumption fails, the Deoptimizer serializes the optimized frame into a FrameDescription, rebuilds the matching Liftoff stack frame and resumes in baseline code mid-function. This lets the optimizer drop generic slow paths that would otherwise block further optimization. The gains matter most for WasmGC languages like Dart, Java and Kotlin: over 50% average speedup on Dart microbenchmarks and 1–8% on realistic applications, with one microbenchmark dropping from 675 ms to 90 ms.

  • Adding the V8 CPU Profiler to v8go

    Shopify Engineering mediumAdept

    Exposing V8's CPU profiler through v8go, the Go library for running JavaScript in V8 isolates via Cgo, came down to a choice between lazily fetching each profile node property with its own Cgo call or eagerly building the whole call tree in C++ and rebuilding it in Go from a single pointer. Cgo calls cost roughly 54 ns Go-to-C and 149 ns C-to-Go, which made eager loading look like the obvious winner. Benchmarks showed lazy loading was actually faster on a small profile (~20µs vs ~25µs), and eager loading only pulled ahead on a large tree from the Hydrogen starter template (~60µs vs ~90µs). Keeping getters over private fields leaves room to offer both modes, and the broader lesson is to benchmark rather than trust intuition and to use inputs that reflect real usage.

  • Land ahoy: leaving the Sea of Nodes

    V8 hardMaster

    V8 is replacing Sea of Nodes in its Turbofan optimizing compiler with Turboshaft, a traditional control-flow-graph IR. The JavaScript backend and the entire WebAssembly pipeline already run on it, and Maglev is taking over the JS frontend. After more than a decade with Sea of Nodes, the team found its theoretical benefits largely unrealized for JavaScript. Checks, loads and stores keep most nodes pinned to the effect or control chains, memory operations rarely float, and the graphs are hard for engineers to read, debug and lower. Explicit control and effect chains make lowerings error-prone, while a CFG stays closer to both the source code and the emitted assembly.

The quest for software engineering knowledge.

Look:
Layout: