Chrome takes new tack for faster JavaScript

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

Stephen Shankland Former Principal Writer
Stephen Shankland worked at CNET from 1998 to 2024 and wrote about processors, digital photography, AI, quantum computing, computer science, materials science, supercomputers, drones, browsers, 3D printing, USB, and new computing technology in general. He has a soft spot in his heart for standards groups and I/O interfaces. His first big scoop was about radioactive cat poop.
Expertise Processors | Semiconductors | Web browsers | Quantum computing | Supercomputers | AI | 3D printing | Drones | Computer science | Physics | Programming | Materials science | USB | UWB | Android | Digital photography | Science Credentials
  • Shankland covered the tech industry for more than 25 years and was a science writer for five years before that. He has deep expertise in microprocessors, digital photography, computer hardware and software, internet standards, web technology, and more.
Stephen Shankland
2 min read

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, (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 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.