Gbuck12DocsWeb Development
Related
Astro’s MDX Integration Transforms Content Workflows: Developers Gain Unprecedented FlexibilityHow to Use CSS contrast-color() for Accessible Text Contrast10 Steps to Recreate Apple’s Vision Pro Scrolly Animation with Pure CSSChoosing Your JavaScript Module System: The First Architecture DecisionGCC 16.1 Ships with C++20 Default, Experimental C++26 and Algol68 Support8 Ways @ttsc/lint Transforms TypeScript Linting into a Single, Blazing-Fast StepBrowser-Based Testing for Vue Components: A Node-Free ApproachAccelerating JavaScript Load Times with Explicit Compile Hints in V8

Chrome 136 Speeds Up Web Pages with New JavaScript Compile Hints Feature

Last updated: 2026-05-04 20:57:43 · Web Development

Chrome 136 Now Allows Developers to Flag Critical JavaScript for Early Compilation

Google’s V8 team has launched Explicit Compile Hints in Chrome 136, a feature that lets web developers mark JavaScript files for immediate compilation during page load. The goal is to slash startup bottlenecks caused by parsing and compiling code on the fly.

Chrome 136 Speeds Up Web Pages with New JavaScript Compile Hints Feature

Early tests show noticeable gains: in a sample of 20 popular websites, 17 saw improvements, with an average reduction of 630 milliseconds in foreground parse and compile times. “This is a leap forward for responsive web apps,” said a V8 engineer familiar with the project.

How Explicit Compile Hints Work

Developers add a magic comment //# allFunctionsCalledOnLoad at the top of a JavaScript file. This tells V8 to eagerly compile every function in that file during initial script processing, rather than deferring compilation until a function is actually called.

Eager compilation happens on a background thread, overlapping with network loading. “If you wait until a function is invoked, it’s too late to parallelize – the main thread stalls,” the engineer explained. The feature is best used sparingly, as overcompiling wastes memory and CPU.

Background: V8’s Compilation Challenge

When V8 processes a script from the network, it must decide for each function whether to compile it eagerly or defer. Deferred functions require a lightweight parse to find their end (JavaScript’s grammar is too complex for brace counting), and then a full parse later – duplicating work.

Eager compilation avoids that duplication and runs in the background. But without hints, V8 has to guess which functions will be needed during page load. Explicit Compile Hints remove the guesswork.

What This Means for Web Performance

For web developers, this feature provides a surgical tool to optimize critical JavaScript files – especially “core” files that contain the bulk of startup logic. “It’s like giving V8 a heads‑up,” said the engineer. “You can now control what gets compiled early without touching your build pipeline.”

The feature is shipping in Chrome 136 and is particularly useful for sites where a single file drives initial interactivity. Developers can also restructure code to create such a core file if needed. Google warns that the magic comment should be used only on files where nearly all functions are called on load.

Testing the Feature Yourself

To see compile hints in action, create two script files. In script1.js, include a function and call it without a magic comment. In script2.js, add //# allFunctionsCalledOnLoad at the top. Then run Chrome with a clean user data directory (to avoid code caching interference) and check the DevTools performance log.

Detailed logging commands are available in the V8 documentation. The team expects broader adoption as more developers experiment with the new hint.

This is a breaking development in browser performance. Explicit Compile Hints are now live in Chrome 136 – test them on your own pages to measure the impact.