Google claims performance improvement for Chrome through JavaScript engine customization

Spread the love

Google has made optimizations to its Chrome V8 JavaScript engine that would lead to performance improvements. Specifically, this involves the addition of the Sparkplug compiler and a mechanism called short builtins.

Google reports that it has run into limitations in improving the V8 engine’s interpreter due to inherent overhead, so the company is adding a new compiler. From version 9.1 this Sparkplug compiler sits between the Ignition and Turbofan compilers. The functions that Sparkplug compiles are already compiled to bytecode, which actually has already done the hard work and doesn’t have to bother with compiling JavaScript sources, Google details. In addition, Sparkplug compiles linearly directly to machine code without generating intermediate representation, resulting in further performance gains, the company said.

For short built-in calls, the V8 engine optimizes the memory location of generated code. CPUs benefit if code snippets for built-in functions, commonly used routines, are placed in the same memory regions as generated code, for optimizations such as branch prediction, among other things. If not, those optimizations may fail resulting in lower performance. Google mentions Apple’s M1-soc as a chip that has to do with this in particular. Google sees the chosen built-in mechanism as a temporary solution, also because it can lead to increased memory usage by V8. For the long term, the development team wants to move JIT code closer to the Chrome binary.

The tweaks have been incorporated into Chrome 91, which came out this week. Google has focused heavily on improving Chrome’s performance in recent months. For example, the browser takes up less memory from version 89 and the browser loads pages faster from version 87.

Improvement of benchmark scores through short built-in calls

You might also like