Chrome takes new tack for faster JavaScript

Google is working on faster regular expression handling for faster JavaScript in Chrome. Translation: faster Web apps.

Chrome programmers have switched out a third-party software package in favor of their own as part of Google's attempt to speed its open-source browser up more.

The change came with a key component for processing JavaScript text called regular expressions. "As we've improved other parts of the language, regexps started to stand out as being slower than the rest. We felt it should be possible to improve performance by integrating with our existing infrastructure rather than using an external library," according to a Chromium blog post by programmers Erik Corry, Christian Plesner Hansen, and Lasse Reichstein Holst Nielsen.

Thus was born Google's own project, Irregexp, the headline feature in the new developer preview version of Chrome, 2.0.160.0 (release notes). Check the blog post if you're curious about the technical details of Google's choices about native code generation, backtracking avoidance, and intermediate automaton representation.

Previously, Chrome used a supporting software package, or library, called JPCRE, a variation by the Webkit browser project of the PCRE package. That eased compatibility issues by making Chrome behave more like Apple's Safari, which is based on Webkit, but Google thinks it's got the compatibility issue in hand.

"During development we have tested Irregexp against one million of the most popular Web pages to ensure that the new implementation stays compatible with our previous implementation and the Web," the programmers said.

Separately, the programmers said they created a new third version of their JavaScript benchmark. This version specifically exercises regular expressions taken from 50 of the Web's most popular pages.

JavaScript is increasingly widely used to build sophisticated Web applications, including Google Docs and Gmail, for example.

Speed is particularly important because JavaScript is used for interactive aspects of Web pages, where fast response or annoying lags are noticeable by people controlling the application. But it's also widely used for many more mundane aspects of Web pages, so JavaScript speedup helps improve Web browsing performance broadly.

Chrome's JavaScript engine is called V8 . Mozilla's Firefox has TraceMonkey , and WebKithas Squirrelfix Extreme . Opera hopes to outdo all those with its own new JavaScript engine, called Carakan .

More changes are coming to V8, though, and Google will detail some at its May developer conference, Google I/O. One session there will focus on the software, including "initiatives that will propel V8 to the next performance level," according to the session notes.

Separately, Google also released the new version 1.0.154.46 of Chrome for both its stable and beta version users on Wednesday. That version fixed a security problem and an issue with Chrome's incognito mode.

About the author

Stephen Shankland has been a reporter at CNET since 1998 and covers browsers, Web development, digital photography and new technology. In the past he has been CNET's beat reporter for Google, Yahoo, Linux, open-source software, servers and supercomputers. He has a soft spot in his heart for standards groups and I/O interfaces.

 

Join the discussion

Conversation powered by Livefyre

Show Comments Hide Comments
Latest Galleries from CNET
Uber's tumultuous ups and downs in 2014 (pictures)
The best and worst quotes of 2014 (pictures)
A roomy range from LG (pictures)
This plain GE range has all of the essentials (pictures)
Sony's 'Interview' heard 'round the world (pictures)
Google Lunar XPrize: Testing Astrobotic's rover on the rocks (pictures)