v136 · javascript
Startup Timer
Measures the simulated parse + first-call overhead for a heavy initialization function, with and without the //# allFunctionsCalledOnLoad magic comment. The benchmark creates a Blob URL from each version, imports it, and times how long the first call takes — showing when eager compilation pays off.
checking performance.mark…
Normally V8 lazy-compiles functions: the bytecode is generated only on the first call. For functions that are always called at startup, this is wasted work — you pay the compilation cost right when responsiveness matters most. The
//# allFunctionsCalledOnLoad magic comment tells V8 to eagerly compile everything in the file, amortising the cost with the initial parse.
Without compile hint
—
ms median first call
With allFunctionsCalledOnLoad
—
ms median first call
Individual runs
Run the benchmark to see results.
What each version looks like
// Click "Run benchmark" to see the generated module snippets.