Google Chrome Performance Improvements
Google has long been blamed for logging resources and slow performance, offering the best browsing features. In its new version 91 rolled out recently, Google has solved, at least bettered the performance of its Chrome browser to be more appealing to the users. As per the Chromium blog post, Google Chrome’s Product Manager, Thomas Nattestad, said that the new Chrome is upto 23% faster than its previous version, saving the users 17 years of their “CPU time each day.” And this is made possible by two new tools – Sparkplug compiler and Short Builtin calls. As explained by Nattestad, the Sparkplug compiler is tasked to fill the “gap between needing to start executing quickly and optimizing the code for maximum performance.” Whereas the “Short builtin calls, will optimize where in memory we put generated code to avoid indirect jumps when calling functions.” Explaining more, the Chrome browser’s JavaScript V8 engine has multiple compilers that generate and share data among them in various phases of execution. The Sparkplug compiler bridges the gap between Ignition and Turbofan – V8 engine’s two-tier compiler system to “generate native machine code without depending on the information gathered while executing the JavaScript code.” This results in faster performance since the execution is down quicker. And the Short builtins is a new mechanism that helps the V8 engine optimize the location in memory of generated code. As Nattestad wrote, “When V8 generates CPU-specific code from JavaScript, it lays that code out in memory. This generated code will frequently call built-in 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.” Further, “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 built-in functions into the same memory region as the generated code.”