• On TechRepublic: Five super-secret features in Windows 7
February 5, 2009 2:55 PM PST

Chrome takes new tack for faster JavaScript

by Stephen Shankland
  • Font size
  • Print
  • 5 comments

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.

Stephen Shankland writes about a wide range of technology and products, but has a particular focus on browsers and digital photography. He joined CNET News in 1998 and since then also has covered Google, Yahoo, servers, supercomputing, Linux and open-source software, and science. E-mail Stephen, or follow him on Twitter at http://www.twitter.com/stshank.
Add a Comment (Log in or register) (5 Comments) (5 Comments)
advertisement
Click Here

About Webware

Say No to boxed software! The future of applications is online delivery and access. Software is passé. Webware is the new way to get things done.

Add this feed to your online news reader

Webware topics

Tech at the Olympics: 'No room to fail'

Q&A The Olympics relies on thousands of servers and PCs to manage all the athletes and scores. Magnus Alvarsson is the guy who must make sure everything works.

How CoverItLive lost it on iPad day

The live-blogging tool fell apart under the strain of a Steve Jobs keynote. Here's what happened, and what comes next for the company.

Inside CNET News

Scroll Left Scroll Right