Paul Krill
Editor at Large

Google boosts V8 JavaScript performance

news
Jun 1, 20212 mins

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

bolts of light speeding through the acceleration tunnel 95535268
Credit: Thinkstock

With the Sparkplug compiler, Google is looking to improve JavaScript performance in its Chrome browser. Sparkplug is debuting in Chrome 91. 

Featured as part of Chrome’s V8 JavaScript/WebAssembly engine, Sparkplug is positioned as a “super-fast” non-optimizing compiler. In a bulletin published May 27, Sparkplug is described as part of a compiler pipeline, nestled between the Ignition interpreter and the TurboFan optimizing compiler. 

Sparkplug compiles from bytecode rather than from JavaScript source. In other words, Sparkplug compiles functions that already have been compiled to bytecode; the bytecode compiler already having done work such as variable resolution, determining if parentheses actually are arrow functions, and desugaring destructuring statements.

And unlike most compilers, Sparkplug does not generate any intermediate representation. Instead, it compiles directly to machine code via a single linear pass over the bytecode, emitting code that matches the execution of that bytecode. The entire compiler is a switch statement inside a for loop that dispatches machine code generation functions.

Google’s V8 developers noted that, since 2016, they have moved away from tracking synthetic benchmarks, such as Octane, to measuring real-world performance of JavaScript outside of the optimizing compiler. Thus, the team has been working on several other aspects of V8 including the parser, streaming, the object model, and caching compiled code.

Paul Krill

Paul Krill is editor at large at InfoWorld. Paul has been covering computer technology as a news and feature reporter for more than 35 years, including 30 years at InfoWorld. He has specialized in coverage of software development tools and technologies since the 1990s, and he continues to lead InfoWorld’s news coverage of software development platforms including Java and .NET and programming languages including JavaScript, TypeScript, PHP, Python, Ruby, Rust, and Go. Long trusted as a reporter who prioritizes accuracy, integrity, and the best interests of readers, Paul is sought out by technology companies and industry organizations who want to reach InfoWorld’s audience of software developers and other information technology professionals. Paul has won a “Best Technology News Coverage” award from IDG.

More from this author