Chrome 136 Delivers Explicit Compile Hints for Faster JavaScript Startup – Developers Can Now Pinpoint Critical Functions
Breaking: Chrome 136 Ships Explicit Compile Hints to Slash Startup Times
Google has released Chrome 136 with a groundbreaking feature called Explicit Compile Hints, giving web developers direct control over which JavaScript functions are compiled during initial page load. Early tests show an average reduction of 630 milliseconds in parse and compile time for popular websites, according to the V8 team.
“Explicit Compile Hints allow developers to mark entire files for eager compilation, ensuring critical functions are ready before they're called,” said a V8 spokesperson. “This can significantly cut the delay users experience when interacting with a page.”
How Explicit Compile Hints Work
Traditionally, V8 must choose between compiling a function immediately (eagerly) or deferring compilation until the function is called. Deferred compilation can cause a bottleneck if the function is called during page load, because the main thread must wait for compilation to finish.
With Explicit Compile Hints, developers can insert the magic comment //# allFunctionsCalledOnLoad at the top of a JavaScript file. This instructs V8 to eagerly compile every function in that file, moving work to background threads and parallelizing with network loading.
However, the V8 team warns against overuse. “Compiling too many functions will consume time and memory, so the feature should be used sparingly – only on core files that are likely to be called during startup,” the spokesperson added.
Performance Data from Real-World Tests
In experiments with 20 popular web pages, 17 showed improvements, with foreground parse and compile times dropping by an average of 630 ms. The feature is especially effective for pages with a “core file” that contains most startup-critical code.
Developers can also reorganize their code to group frequently called functions into a single file, then apply the hint to that file for maximum impact. “This transforms how we optimize JavaScript loading,” said a Google performance engineer. “It's like giving V8 a roadmap instead of letting it guess.”
Background: The JavaScript Startup Bottleneck
Getting JavaScript running fast is key for responsive web apps. Even with V8's advanced optimizations, parsing and compiling critical JavaScript during startup can create performance bottlenecks. When a script loads from the network, V8 must decide for each function: compile it eagerly or defer.
If a deferred function is called later, V8 must compile it on demand – and that work cannot be parallelized with network loading. Additionally, light parsing to find function boundaries duplicates effort later. Explicit Compile Hints solve this by letting developers make the decision upfront.
What This Means for Web Developers
Explicit Compile Hints give developers a new lever to optimize perceived performance. By marking files that contain startup-critical functions, they can reduce the “time to interactive” for users. This is particularly valuable for complex single-page applications or news sites with heavy JavaScript.
To test the feature, developers can run Chrome with a clean user data directory and use the --log-function-events flag to observe which functions are compiled eagerly. The V8 team provides sample HTML and JavaScript files to demonstrate the effect.
As web performance benchmarks become more competitive, tools like Explicit Compile Hints shift the balance from “magic” optimization to developer control. Expect more frameworks and build tools to adopt this hint in their bundling pipelines.
For more details, see the original V8 blog post on Explicit Compile Hints and the background on JavaScript parsing.