Get the latest tech news

Turbocharging V8 with mutable heap numbers · V8


Adding mutable heap numbers to script context

This post details a specific optimization we made that yielded a significant 2.5x improvement in the async-fs benchmark, contributing to a noticeable boost in the overall score. Larger numbers or those with decimal parts are stored indirectly as immutable HeapNumber objects on the heap (a 64-bit double), with the ScriptContext holding a compressed pointer to them. This, in turn, contributes to a~1.6% improvement in the overall JetStream2 score .This demonstrates that seemingly simple code can create unexpected performance bottlenecks, and that small, targeted optimizations can have large impact not just for the benchmark.

Get the Android app

Or read this on Hacker News

Read more on:

Photo of Turbocharging V8

Turbocharging V8

Photo of mutable heap numbers

mutable heap numbers