Google claims performance improvement for Chrome by tweaking JavaScript engine

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 running into limitations in improving the V8 engine’s interpreter due to inherent overhead, so the company is adding a new compiler. This Sparkplug compiler sits between the Ignition and Turbofan compilers from version 9.1. The functions Sparkplug compiles are already compiled to bytecode, essentially doing the hard work and not having to deal with compiling JavaScript resources, Google specifies. In addition, Sparkplug compiles linearly directly to machine code, without generating intermediate representation, which provides further performance gains, the company said.

For short builtin calls, the V8 engine optimizes the memory location of generated code. CPUs benefit if code snippets for builtin functions, commonly used routines, are placed in the same memory regions as generated code, including for optimizations such as branch prediction. If not, those optimizations may fail, resulting in lower performance. Google calls Apple’s M1-soc as a chip that is mainly related to this. 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 adjustments have been incorporated in Chrome 91, which appeared 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 faster from version 87.

Improvement of benchmark scores through short builtin calls

You might also like