$this->articleCE->primaryUrlById(3751516) = /dev-news/article.php/3751516/Whos+King+of+the+Browser+Speed+Jungle.htm
Who's King of the Browser Speed Jungle? - InternetNews.
RealTime IT News

Who's King of the Browser Speed Jungle?

The battle for Web browser performance bragging rights is all about speed. Both Apple Safari and Mozilla Firefox are jostling for the title of fastest browser, with one of the key metrics being how fast JavaScript performs.

Apple this week upped the stakes with the new SquirrelFish bytecode JavaScript interpreter, which it claims offers significant performance improvements.

JavaScript performance is critical for Web developers and users since it has an impact on how quickly Web sites (especially Ajax-heavy sites) load and perform.

SquirrelFish is now part of the Safari nightly build, although it is not yet included in the main, generally available Safari 3.1.x release. According to Safari developers, SquirrelFish is 1.6 times faster than its current JavaScript interpreter.

In a test done by Web developer Charles Ying and posted on his blog, the SquirrelFish engine outperformed the Tamarin JavaScript engine from Adobe, which is currently being expanded for future use by Mozilla. Tamarin sports a feature called "tracing," designed to enable faster code.

"On the SunSpider JavaScript benchmark, SquirrelFish is at least 1.9 times faster than Tamarin with tracing turned on; 1.8 times faster than 'vanilla' Tamarin, the same engine used in Flash 9," Ying wrote.

So where does that leave Mozilla's Firefox?

According to Mike Shaver, chief evangelist for the Mozilla Foundation and a co-founder of the Mozilla Project itself, the upcoming Firefox 3 browser release will still be using SpiderMonkey as its JavaScript engine -- as it has for a decade. But the latest release of the browser will feature an upgraded version of the engine.

"It's still SpiderMonkey, only substantially more awesome this time," Shaver told InternetNews.com.

Additionally, Mozilla is working on implementing Tamarin technology in its browser by way of the ActionMonkey project. Shaver said the goal of ActionMonkey is to wedge Tamarin into Firefox and make it match Mozilla's existing APIs.

"We're working on a constant cycle of JavaScript performance improvements," Shaver said. "There are areas in which SpiderMonkey is faster than Tamarin and areas where it's not. We're looking to build hybrids that are best-of-breed for both worlds and we're going to pull those into the Firefox release when ready."

Mozilla is also working on improving the JavaScript language itself. JavaScript was originally created by current Mozilla CTO Brendan Eich while at Netscape.

"Brendan interesting in making sure that JavaScript evolves as a language," Mike Beltzner, Firefox's product lead, told InternetNews.com. "In Firefox 2, we had JavaScript 1.7, in Firefox 3, we have JavaScript 1.8 and with each revision, there are new methods and mechanisms to make programming tasks easier."

As for how Mozilla stacks up against the new Apple SquirrelFish, Shaver did not deny that the newest contender provides a performance leap.

"They've dropped SquirrelFish in now and got a big speed up there," he said. "We've got more coming on our side. You'll see this leapfrog pattern over and over. We're not going to let anybody slack on that and the other browser vendors need to keep up, too.

Shaver added that he suspects SquirrelFish is faster than SpiderMonkey, though that situation may be likely to change soon.

"We've been in our release lockdown for three months now -- we've got a bunch of stuff queuing up that you'll see in the next few months," Shaver said.

Still, the race toward improved JavaScript engine performance may one day end as a result of all the gains browser vendors are now making.

"As we each keep grinding performance down, you just get to the point where there is not a lot of room to maneuver," Shaver said. "Even if you're twice as fast, it's only a few milliseconds' difference for a user. But we're reaching the point where JavaScript performance is irrelevant, because it's so fast."