Not all browsers are made equal in speed
April 3, 2006Today I had an enlightening experience. As I complained a couple of days ago, @Sweeper 0.8 (my Morfik Mine Sweeper clone) was dead slow when switching into Intermediate or Expert mode due to a lot of control demolitions/creations going on in the background. So I decided that some optimization was in order and today just wanted to look into doing this when (almost by coincidence) I discovered that the speed was much-much better (almost palatable for even a maximalist) than I originally experienced. What gives?
When I develop with Morfik, it uses Internet Explorer (6.0 XP/SP2) by default to run the application. I discovered the performance problems this way while running the app from the IDE.
Today I started the app from the command line (I wanted to take a look at the generated code) and it came up in Firefox (1.5) since that is the default browser on the same machine. Was I surprised seeing that it was noticeably faster to switch modes!
My first reaction was to think of a few ‘nice’ words about my ignorance in forgetting how an IDE can affect performance by doing some extra hops for debugging in the background (in retrospect: is this so in Morfik’s case? I’ll figure that out…).
Then I remembered that indeed I had done some profiling the other day and narrowed down the possible number of lines for the performance issue quite a lot and none of those lines should be affected by IDE magick.
So decided to do some investigations and did profile the same task (switching from Basic into Expert) in both browsers on the same machine with the same conditions (only the two browsers loaded, average of 5 runs for each). Here are the results:
- Internet Explorer finished on average in 18.34 secs
- Firefox finished on average in 3.38 secs
Now, that IS a difference. In this test Firefox was faster by cca. 5.42 times.
One could say that this is irrelevant and why do I care in the first place? The answer is simple. New web applications (based on AJAX) and many Web 2.0 frameworks (Morfik, Backbase, the new OpenLaszlo DHTML renderer, Ruby on Rails, etc.) rely on the browser as a UI rendering engine. Such great differences in speed mean that either the browser manufacturers will have to tune their solutions to be more in line or we application developers will have again to do some magic to mitigate the differences (of course, this is not optimized code, but that is not the point, OK?).
If you want to take a look at the results first hand, you can do it by either running the Mine Sweeper app from the Morfik Dev2Dev site or downloading the source code and running it locally (it is pre-compiled in the archive).

[...] People are often shouting about how browser X is
Ajaxian » IE vs. FireFox: Browser Speed | April 7, 2006[...] People are often shouting about how browser X is faster than browser Y. Peter Illes happened upon a test, and found that his setup showed a large performance improvement in FF over IE: o decided to do some investigations and did profile the same task (switching from Basic into Expert) in both browsers on the same machine with the same conditions (only the two browsers loaded, average of 5 runs for each). Here are the results: [...]
Try Opera. Much faster than any other browser.
just | April 8, 2006Try Opera. Much faster than any other browser.
I have posted this question on Ajaxian and I post
Mario | April 8, 2006I have posted this question on Ajaxian and I post it here too.
In my projects which are targeted toward slower machines, I find Moz to be faster. For example I create 500 instances of an object which as properties. In IE it takes 1.4 seconds to 2.4 seconds depending on the speed of the machine, in Moz it takes 233ms to 400ms. Now I find that if you have arrays and set then with object references (ex: myObj.children.push(anotherObject) ) that’s whats slows IE down. Without the array Object Refs IE runs the 500 instances at 730ms which si still slower than Moz but I can live with it. Does anyone else have this problem with arrays and object refs????
Another good site: http://www.howtocreate.co.uk/browserSpeed.html. Very useful.
Andrew | April 9, 2006Another good site: http://www.howtocreate.co.uk/browserSpeed.html. Very useful.
This really shows how very inefficient JavaScript is. It took me
Henrik Feldt | April 9, 2006This really shows how very inefficient JavaScript is.
It took me 1m 40s to switch from Beginner to Expert in FF1.5.0.1, using 70% of CPU capacity. (I got Intel Prescott 3.4 GHz, 1 GB DDR2 RAM) The other 30% was used by AVG-antivirus.
Conclusion - use C# if you wanna produce a mine-sweeper game.
Andrew: Thanks for the link. That is a very good
piprog | April 9, 2006Andrew: Thanks for the link. That is a very good summary. It was also mentioned by András Tarsoly @ Ajaxian. If you are the same, then double kudos :-)
Henrik: No, this does not mean that we have to code everything in C#. It means that (a) the browser vendors should enhance their products now that they are used for things the browsers were not intended for in the first place and (b) in the xApp/Web 2.0/AJAX world it will be again important to think about how we write our code to keep it performant (an infinite loop can bog down an infinitely strong system in any language, anyway:-).
[...] I’m not sure why, but everytime i design a
Browse Happy - a view of browsers at amjoe.com | April 10, 2006[...] I’m not sure why, but everytime i design a site i’ve to consider all the hacks for ie because it does not take in to account all the standards and does not support png (well atleast the aplha channels) Let alone those lets take the performance point of view, ie being integrated in to the OS it should be much much faster than any other browsers out there but take a look at this test results [click here] Firefox is about 600% faster than the ie, Now there could be other tests that proove ie to be great oh yeah we all know that. [...]
[...] The performance of Javascript and DOM manipulation is also
AMIS Technology blog » Blog Archive » Pitfalls in Internet Explorer – How to cover them up or walk around them | May 31, 2006[...] The performance of Javascript and DOM manipulation is also a noticably worse than FireFox. I didn’t do any testing yet, but someone wrote an article about it. [...]
I modified the links to the code due to some
piprog | May 31, 2006I modified the links to the code due to some re-arrangements on the Morfik site.
[...] Now this is a completely un-scientific, but very revealing
piBlog » Browser graphics: speed discrepancies galore with clear Safari lead… | June 28, 2007[...] Now this is a completely un-scientific, but very revealing experience. I have run the same page (Sebastien Gruhier’s PGF test page) in four different browsers with interesting results. This is indeed a continuation of my earlier “research” into “Not all browsers are made equal in speed”. [...]
I have made my own speed test betwen IE and
dan | December 7, 2007I have made my own speed test betwen IE and Firefox.
You can check the script and even test it and see the HUGE difference danns-blog.blogspot.com/2007/09/ie-vs-firefox-test-in-speed.html
Firefox is still much slower then MSIE in every extent
Zephir | May 11, 2008Firefox is still much slower then MSIE in every extent by my opinion.
image download test, dynamic rendering test