Sign in with
Sign up | Sign in

Firefox 3 And Safari 4 In Browser Speed Race

By - Source: Tom's Hardware US | B 8 comments
Tags :

 

Chicago (IL) - Most of today’s web sites and web applications are built using the JavaScript scripting language. Some may say that a trend towards the fine-tuning of JavaScript interpreters in modern browsers was just a matter of time since any such optimization translates into performance gains. Mozilla recently launched the browser speed race with Firefox 3, which delivers more speed than any other previous Firefox version. Apple answered with Safari 4, claiming the browser’s JavaScript engine has been accelerated by 53%. Welcome to the browser speed race.

Safari 4 has just been seeded to the developers at Apple’s developer conference. The manufacturer claims that the software has a 53% faster JavaScript engine than the preceding and current version 3.1 (based on the SunSpider JavaScript Performance test conducted on iMac with an Intel Core 2 Duo processor at 2.8 GHz, with 2 GB of RAM and running under Mac OS X Snow Leopard.) Although Firefox 3 RC3 was the first to deliver significant JavaScript performance improvement, Apple apparently is exceeding those gains with Safari 4.

Apple uses a new and improved JavaScript interpreter code-named SquirrelFish, which is provided on an open-source basis from the WebKit project, the same organization that makes the open-source engine used by Safari to render web pages. According to the WebKit project, the SquirrelFish engine is 1.6 times faster than the JavaScript engine in Safari 3.1.

SquirrelFish does its magic by turning JavaScript script into so-called bytecodes, an optimized code much more suitable for run-time execution than natural language-based JavaScript commands, which are longer and more complicated to interpret - and therefore are slower.

Why JavaScript performance matters

Most today’s web applications and web 2.0 sites rely on the JavaScript scripting language originally created by current Mozilla CTO Brendan Eich while he was employed by Netscape. JavaScript acts as glue that connects a user interface rendered in a web browser with a database and programming logic running in a web server. The browser’s JavaScript engine is solely responsible for interpreting and executing JavaScript commands embedded in HTML code. As a result, a browser’s JavaScript engine performance is directly related to the performance and responsiveness of a web application, contributing to an improved user experience.

The fact that many applications grow in size and become more bloated with each release means that a browser that can run web applications faster and make user interfaces more responsive on any computer is actually a big deal. You don’t have to have any specific market forecasting talent to predict that this trend may be impacting browser market shares: Speed can directly translate into more usability for most of us. Clearly, JavaScript handling is on its way to become a powerful weapon in the browser market.

SpiderMonkey, SquirrelFish, Tamarin and more

Mozilla was the first to introduce significant speed gains with Firefox 3 beta 5 (the final version is expected to ship by mid-June). Firefox has its Gecko engine to render web pages, which is generally considered to be slightly slower than Safari’s WebKit - which is largely responsible for the "fastest browser in the world" status Safari enjoys. Firefox’ JavaScript implementation is based on Mozilla’s own and decade old SpiderMonkey technology, which many considered to be the fastest JavaScript interpreter until SquirrelFish came out.

Although in beta, Firefox 3 scored with many reviewers who are praising the browser’s performance improvements, with WSJ’s Walt Mossberg declaring the browser a "winner." But now that the SquirrelFish/Safari combination appears to be offsetting the speed gains in Firefox 3 and may set a new benchmark, we can expect more direct competition between Mozilla and Apple. Mozilla has plans to expand SpiderMonkey with Adobe’s JavaScript engine called Tamarin, included in Flash 9, which has a so-called "tracing" feature designed to enable faster code execution. However, the SunSpider JavaScript benchmark claims that SquirrelFish is at least 1.9 times faster than Tamarin.

Mozilla plans to wedge Tamarin into Firefox and match the API’s of both technologies "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 co-founder Mike Shaver recently said.

Can IE8 compete?

The big variable in this game is Microsoft’s Internet Explorer 8, currently in beta 1 phase. IE8 is expected to deliver speed gains in JavaScript performance as well. However, Microsoft is facing a tough task. The fact that the software giant is often criticized for delivering bloated and inefficient software certainly doesn’t help. In our tests, the first beta of IE8 shows no noticeable speed gains in running web applications.

Quite the opposite is the case, actually. Websites and web applications run noticeably slower than in IE7. The whole browsing experience generally appears to be less responsive. Of course, IE8 is in an early development stage and you can bet Microsoft is going to tweak its performance. The only problem is that the software giant will have to work to raise the stakes in the browser race. If IE8 under-delivers, the market could respond with further market share erosion for IE. It is evident now that JavaScript engine performance has become a key metric in the newest race for the title of fastest browser.

The battle ahead is nicely summed by Mozilla co-founder Mike Shaver who said the following: "They [Apple] have dropped SquirrelFish in now and got a big speed up there. 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."

According to Net Applications, Firefox 3 captured almost one fifth (18.41%) of the browser market in May, followed by Safari 3.1 which hit 6.25%. Microsoft’s Internet Explorer continues on its pace of a slow but steady decline, ending up at 73.75% in May. Microsoft has scheduled second beta of IE8 for an August release, with a generally expected final release in the fourth quarter of this year.

Discuss
Ask a Category Expert

Create a new thread in the News comments forum about this subject

Example: Notebook, Android, SSD hard drive

This thread is closed for comments
  • 0 Hide
    fulle , June 12, 2008 12:55 AM
    Firefox 3 actually resolved a few small issues I had with 2, and has given me no errors whatsoever so far... and it seems faster so far. So, if anyone is hesitant about trying it, I'd recommend checking it out. Most of my favorite addons, like piclens, were already compatible with Firefox 3 as well.

    I sort of feel sorry for people still using IE6 or IE7. Microsoft has had an inferior browser for years.
  • 0 Hide
    jalek , June 12, 2008 4:05 AM
    I still see people running IE 5.1 on MacOS..

    So, is Opera going to get into this game?
  • 0 Hide
    justjc , June 12, 2008 6:28 AM
    Any good reason why Opera didn't get a mention? It was after all the fastest browser before Firefox 3 came out and it could be interesting to see how it messures up today. However if you cover the final release of Opera 9.5 with a speed test you're forgiven ;) 
  • Display all 8 comments.
  • 0 Hide
    mitch074 , June 12, 2008 7:39 AM
    Browser speed comparisons if quite often subjective, and very dependent upon external factors:

    - Safari enjoys a lot of speed gains on Mac OS X because it uses undocumented APIs; these APIs are not stable, thus the only way to really gain from them is to keep the browser in flux. The Mozilla team is at a disadvantage here because it aims at delivering a stable browser that doesn't rely on tricks; moreover, Firefox releases are extensively tested by the whole community, while Safari is tested by... Apple. Which delivered a heavily unsafe browser release no later than last week. A 'good' way to compare the browsers is by running both on a 'neutral' platform: Windows (nice, as it puts IE8 to shame), or Linux (where both development teams have access to all APIs indiscriminately).

    - Gecko 1.9 is still mostly backward compatible with 2001's Gecko 1.0 release. Several internal APIs have been kept for compatibility reasons, but slow down code execution. The 'real' speed gains (in Javascript) will probably be found in Firefox 4/Gecko 2 (as the article mentioned, but didn't expand upon) with Tamarin, and it will be cumulative with the next point.

    - Firefox uses Gecko for its whole UI; this helps against code branching, because the same javascript,CSS etc. files are used for a UI element on win32, OS X or X11, but it does slow things down. Safari can be found on Mac OS X, and is ported to Windows. To overgeneralize, Firefox is a platform-agnostic application running on its Gecko toolkit (so, if Gecko gets faster, Firefox gets faster too), Safari has native ports.

    As for Opera, well, it is... Special. Don't take it negatively, but it actually is the odd one out there. Yes, it's fast, stable, and filled with nice features; it's standards-compliant; it's available on multiple platforms. Yet, you hardly can follow its development (it's better than IE, sure; compared with Minefield and Webkit nightly releases, though...) and it's not big enough to shake things with its not too frequent releases. It also lacks powerful developer tools (Firebug, which is a deal breaker for Firefox, but also the Netscape legacy), doesn't have a shiny UI (where Safari, well, shines) and is distributed with... er... nothing (IE keeps existing because of Windows, Safari is force-fed through iTunes and Mac OS X, Firefox has a community of enthusiasts).
  • 0 Hide
    Wheat_Thins , June 12, 2008 12:34 PM
    As long as IE keeps declining I will keep smiling.
  • 0 Hide
    Anonymous , June 14, 2008 6:55 AM
    And what about Firefox being a "memory hog"? Not kidding. Check it out.
    I think IE6 is the best. Although I use firefox2 for all the GREAT!!! addons.
  • 0 Hide
    Anonymous , June 15, 2008 1:49 AM
    Firefox 3 supposedly has a lot more in place to clear down memory, and remove the 'hogging'.
    The problem will most likely come in two forms: lots of tabs, or running Linux.
    Lots of tabs=lots of memory - no way around this EVER.
    Running on Linux=ext3 disk writing 'bug', which can freeze it up for a few seconds/minutes.. Simply uses too many fsync() calls.
  • 0 Hide
    Anna sui , December 20, 2010 11:27 PM
    Firefox is really wonderful, which is faster and easy handled, but get freezing sometimes, so I use tuneup360 to help me solve these problems~~