Skip to main content

Chrome 91 is up to 23% faster, thanks to new JavaScript compiler, memory optimizations

Google rolled out the latest version of its browser this week with the ability to freeze Tab Groups and have PWAs launch on startup. Under-the-hood, Chrome 91 is 23% faster, thanks to a pair of JavaScript additions

An important component of delivering a fast browser is fast JavaScript execution. In Chrome, that job is done by the V8 engine, which executes over 78 years worth of JavaScript code on a daily basis. 

It starts with a new JavaScript compiler that “fills the gap between needing to start executing quickly and optimizing the code for maximum performance.” Chrome uses a compiler called Ignition for the former scenario and Turbofan in the latter. Both were introduced three years ago as a part of a two-tier compiler system.

Ignition is a bytecode interpreter whose job is to start executing the JavaScript with as little delay as possible. Turbofan is the optimizing compiler that generates high-performance machine code based on information gathered during JavaScript execution; as a result, it starts up more slowly than Ignition’s bytecode compiler.

Sparkplug adds another compiler and “strikes a balance” between the two in that it generates native machine code, but doesn’t depend on information learned while executing the JavaScript code.

This lets it start executing quickly while still generating relatively fast code. For a complete technical deep dive into what it took to make this new engine, please see our V8 blog post.

Meanwhile, short builtins have the V8 engine optimize where in memory generated code is placed to avoid indirect jumps when calling functions.

When V8 generates CPU-specific code from JavaScript, it lays that code out in memory. This generated code will frequently call builtin functions, which are small snippets of code for handling common routines –everything from basic operations like adding two variables, to full-fledged functions in the JavaScript standard library. For some CPUs, calling functions that are further away from your generated code can cause CPU-internal optimizations (such as branch prediction logic) to fail. The fix for this is to copy the builtin functions into the same memory region as the generated code. 

Google says short builtin calls are “especially impactful for the new Apple M1 chip” with more technical details available here. In all, Chrome 91 is now up to 23% faster and saves 17 years of user CPU time every day with these JavaScript updates.

FTC: We use income earning auto affiliate links. More.

You’re reading 9to5Google — experts who break news about Google and its surrounding ecosystem, day after day. Be sure to check out our homepage for all the latest news, and follow 9to5Google on Twitter, Facebook, and LinkedIn to stay in the loop. Don’t know where to start? Check out our exclusive stories, reviews, how-tos, and subscribe to our YouTube channel

Comments

Author

Avatar for Abner Li Abner Li

Editor-in-chief. Interested in the minutiae of Google and Alphabet. Tips/talk: abner@9to5g.com

Manage push notifications

notification icon
We would like to show you notifications for the latest news and updates.
notification icon
You are subscribed to notifications
notification icon
We would like to show you notifications for the latest news and updates.
notification icon
You are subscribed to notifications