Google’s Chrome browser already enjoys something of a reputation for speed, and the most recent stable version to debut–Chrome 18–extended that further by improving graphics performance on both new and older hardware.
Now, however, it looks like upcoming versions of the software could be even speedier thanks to new technology in its V8 JavaScript engine.
âAs of current dev and beta channel releases, V8 uses a new algorithm based on counters to decide which functions to optimize,â wrote Google software engineer Jakob Kummerow in a blog post on Tuesday. âThis greatly increases performance for small JavaScript programs.â
On the SunSpider benchmark, in fact–one that focuses on very short-running tests–V8′s speed has improved by about 25 percent, as indicated in the chart below.
Two Alternate Compilers
To execute JavaScript, Google’s open source V8 engine begins by compiling to machine code with a quick compiler that doesn’t perform any optimization on the code it produces.
Credit: GoogleA second, optimizing compiler is available that can generate faster machine code, but it takes much longer and thus must be used selectively, Kummerow explained. Accordingly, V8 is designed to try to predict which functions will benefit most from optimization and use that second, more time-intensive technique only on the most promising candidates.
âIn the past, V8 stopped once every millisecond to look at currently running functions, and eventually optimized them,â he noted. âFor long-running programs, this worked great, but short-running programs often finished before they could benefit much from the optimizing compiler.â
V8 also sometimes made different optimization decisions each time a JavaScript program ran, with the result that small but performance-critical functions were occasionally overlooked.
Better Optimization
The new version of V8, by contrast, optimizes sooner and more consistently by analyzing the running program in more detail, Kummerow said. Specifically, the new technology uses counters to keep track of how often JavaScript functions are called and loops are executed in a program, thereby approximating the time spent inside each function.
âThat way, V8 is able to quickly gather fine-grained information about performance bottlenecks in a JavaScript program, and to make sure that the optimizing compiler’s efforts are spent on those functions that deserve it most,â he said.
Bottom line? The current beta version of Chrome 19 and its successors promise the benefit of an extra shot of speed.
Want to try out the latest beta version? It’s available as a free download for Windows, Linux, and Mac OS X from the Chrome site.
Katherine Noyes has been an ardent geek ever since she first conquered Pyramid of Doom on an ancient TRS-80. Today she covers business and tech in all its forms, with an emphasis on Linux and open source software. You can also find her on Google+ and Twitter.
![]()
