Click here to Skip to main content
15,884,993 members
Articles / Web Development / HTML

Simple Browser Iteration Test

Rate me:
Please Sign up or sign in to vote.
3.50/5 (2 votes)
25 Mar 2009CPOL 25.5K   76   6   8
Check different browsers' responses to a simple iteration test (JavaScript).

Introduction

There is a big battle out there about Internet Browsers! Everyone says their browser is the best and fastest. I think this is the time that we CodeProject guys should start to create our test tools and not listen to what ads say.

I am not a professional tester in this case. As a web developer, my first concern is the iteration speed. For this purpose, I have created a kid-level HTML page to iterate 10,000 times and add a simple text to a text area within the page:

HTML
<html>
<head>
 <title>Simple Browser Iteration Test</title>
</head>
<body>
 <textarea id="text" style="height: 300px;" cols="80" rows="20"></textarea>
 <script language="javascript" type="text/javascript">
  var t = document.getElementById("text");
  var d1 = Date();
  for (var i = 0; i < 10000; i++) {
     t.value += i.toString();
  }
  var d2 = Date();
  document.write("<br />" + d1 + "<br />" + d2);
</script>
</body>
</html>

As you can see, it is really simple and does not need any extra explanation.

The following are the results of running this page on my machine in different browsers:

1. IE8-64bit: ~6 sec

IE8-64bit.png

2. IE8-32bit: ~7 sec

IE8-32bit.png

3. Chrome 1.0.154.53: ~12 sec

Chrome.png

4. FireFox 3.0.7: ~4min and 56sec

FireFox.png

I think you got the main idea. I request to create an Open Source project here to work on Browsers in real action tests in which everyone can check their code and make any suggestions. It would help to find out the reality, not what vendors say!

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Architect
United States United States
I got my BS in Software Engineering from Iran, worked there for 4.5 years mainly in industrial automation field. Then I moved to Australia. In Australia, I had a great chance to work at some big companies. Since 2009 I have been living in the States. I received my MS in Information Systems from Illinois State University. Currently, I am a Senior Software Development Engineer.

Comments and Discussions

 
QuestionHardware? Pin
Danila Korablin30-Mar-09 2:51
Danila Korablin30-Mar-09 2:51 
AnswerRe: Hardware? Pin
Tecfield30-Mar-09 14:59
Tecfield30-Mar-09 14:59 
Generalsomehow I do not care which one is fastest browsers. Pin
Gevorg28-Mar-09 4:53
Gevorg28-Mar-09 4:53 
Me, as a developer, simply do not care which one is faster.
So what that Safari is fastest? Until IE has 70% of the market and Firefox has 25% of the market.
All I care is that my application works with IE and FireFox. Even if those two are be slowest, buggiest browsers that exists ( I exaggerated here just to make my point).
And I do not care about Safari, Netscape, Opera....


George.

My site - Body Jewelry
Not my site - Piercing info

GeneralRe: somehow I do not care which one is fastest browsers. Pin
Tecfield29-Mar-09 3:17
Tecfield29-Mar-09 3:17 
GeneralSafari got hole process in just 3 sec nice Pin
kru27-Mar-09 0:50
kru27-Mar-09 0:50 
GeneralRe: Safari got hole process in just 3 sec nice Pin
Tecfield27-Mar-09 19:39
Tecfield27-Mar-09 19:39 
GeneralIE , Firefox Table Pin
Member 400479926-Mar-09 21:26
Member 400479926-Mar-09 21:26 
GeneralRe: IE , Firefox Table [modified] Pin
Tecfield29-Mar-09 3:15
Tecfield29-Mar-09 3:15 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.