Google boosts V8 JavaScript performance

Google boosts V8 JavaScript performance



‘Super-fast’ non-optimizing Sparkplug compiler, which compiles bytecode to machine code, makes its debut in V8 9.1 and Chrome 91.



Google boosts V8 JavaScript performance
ThinkStock


Google is using the Sparkplug compiler to optimise JavaScript performance in its Chrome browser. Sparkplug makes its public debut in Chrome 91.

Sparkplug is a non-optimizing compiler that is included as part of Chrome's V8 JavaScript/WebAssembly engine. Sparkplug is described as a component of a compiler pipeline, nestled between the Ignition interpreter and the TurboFan optimising compiler, in a bulletin published on May 27.

Sparkplug generates bytecode rather than JavaScript source code. In other words, Sparkplug compiles functions that have already been compiled to bytecode, with the bytecode compiler having already performed tasks such as variable resolution, determining whether parentheses are actually arrow functions, and desugaring destructuring statements.

Additionally, unlike the majority of compilers, Sparkplug generates no intermediate representation. Rather than that, it compiles directly to machine code using a single linear pass over the bytecode, emitting code that corresponds to the bytecode's execution. The compiler is composed entirely of switch statements contained within a for loop that dispatches machine code generation functions.

Google's V8 developers noted that they have shifted their focus away from synthetic benchmarks such as Octane and toward measuring real-world JavaScript performance outside of the optimising compiler since 2016. As a result, the team has been focusing on several other aspects of V8, including the parser, streaming, the object model, and code caching.

No comments

The Creative Web Team. Powered by Blogger.