<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>MentorMate Company Blog&#187; Georgi | MentorMate Company Blog</title>
	<atom:link href="http://mentormate.com/blog/author/georgi/feed/" rel="self" type="application/rss+xml" />
	<link>http://mentormate.com/blog</link>
	<description></description>
	<lastBuildDate>Thu, 12 Aug 2010 14:59:08 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Is the Google Chrome Browser faster than Internet Explorer in JavaScript performance?</title>
		<link>http://mentormate.com/blog/google-chrome-browser-faster-internet-explorer-javascript-performance/</link>
		<comments>http://mentormate.com/blog/google-chrome-browser-faster-internet-explorer-javascript-performance/#comments</comments>
		<pubDate>Tue, 15 Dec 2009 17:38:52 +0000</pubDate>
		<dc:creator>Georgi</dc:creator>
				<category><![CDATA[IT]]></category>
		<category><![CDATA[browser]]></category>
		<category><![CDATA[chrome]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[ie]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[performance]]></category>

		<guid isPermaLink="false">http://mentormate.com/blog/?p=259</guid>
		<description><![CDATA[On November 19, 2009 Google announced their open source Chrome operating system built around the core tenets of speed, simplicity and security. The presentation started with a slide showing the increasing number of Chrome users – the browser that is used as a base in their OS. The slide also stated that Chrome has “39x faster JavaScript than Internet Explorer.” Is it really that much faster or faster at all? Will their built from scratch “V8 JavaScript Engine”  outplay the latest version of the Microsoft browser and will it work almost 40 times faster?]]></description>
			<content:encoded><![CDATA[<h2>JavaScript Speed in Google Chrome versus Internet Explorer</h2>
<p>The latest stable version of Chrome browser at the time this article was written was 3.0.195.33. We will compare it to the current version of IE, which is 8.0.6001.18865. We started with Google’s own benchmark that is hosted at their site and is called <a href="http://v8.googlecode.com/svn/data/benchmarks/current/run.html" target="_blank">V8 Benchmark Suite</a>.  The result differed from one machine to another, but the score of the Google browser was always about 38 times higher than the one of IE – very close to the numbers that Google is claiming. Of course, as much we believe in the accuracy of the tests, we wanted to use some independent benchmarking sites, too. After some research, we found some of the major ones are <a href="http://www2.webkit.org/perf/sunspider-0.9/sunspider.html" target="_blank">SunSpider JavaScript Benchmark</a> and <a href="http://jsbenchmark.celtickane.com/" target="_blank">JSBenchmark</a>. Their tests are a complex mixture of different tasks, including drawing, code decompression, encrypting and operations with arrays, dates and handling exceptions. As we expected, the difference between the two browsers was much smaller compared to Google’s own test, but it was again pretty impressive. The results differed from platform to platform, but overall the “SunSpider” test showed that Chrome is ten times faster, while the “JSBenchmark” reported that it is “only” seven times faster.</p>
<h2>JavaScript Speed Test</h2>
<p>In order to conclude that Internet Explorer is much slower than Google Chrome in JavaScript performance though, we still needed more facts. As an alternative to the complex and heavy testing suites, we created a very short example with few array operations. We wanted it to be fairly simple and pretty close to real life examples. Basically, this piece of code assigned random numbers to an array of 20,000 items. Then we reversed the order of the elements. In the next two steps we sorted it in ascending and descending order. The script outputs the milliseconds needed for its completion. We did not expect a lot of difference in doing something so basic. Here is the code:</p>
<h2>JavaScript Speed Test Source Code</h2>
<pre class="brush: plain;">
&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Strict//EN&quot;
    &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd&quot;&gt;
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot; xml:lang=&quot;en&quot; lang=&quot;en&quot;&gt;
	&lt;head&gt;
		&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html;charset=utf-8&quot; /&gt;
		&lt;title&gt;MentorMate JavaScript simple speed test&lt;/title&gt;
		&lt;script type=&quot;text/javascript&quot;&gt;
			&lt;!--
			function testStart() {
				var mySampleNumbers = new Array();
				var now;
				var start_time_mill;
				var end_time_mill;

				//gets the start date
				now = new Date();
				start_time_mill = now.getTime();

				//assigning random numbers to an array of 20 thousand items
				for (i=0;i&lt;=20000;i++) {
					mySampleNumbers[i] = Math.random();
				}

				//reverse the order of the elements in an array
				mySampleNumbers.reverse();

				//sort the numbers (ascending)
				mySampleNumbers.sort(sortAsc);

				//sort the numbers (descending)
				mySampleNumbers.sort(sortDesc);

				//gets the end date
				now = new Date();
				end_time_mill = now.getTime();
				displayResult(end_time_mill - start_time_mill);
			}
			function sortAsc(m, n) {
				if (m &gt; n) {
					return 1;
				}
				else if (m &lt; n) {
					return -1;
				}
				else {
					return 0;
				}
			}
			function sortDesc(m, n) {
				if (m &gt; n) {
					return -1;
				}
				else if (m &lt; n) {
					return 1;
				}
				else {
					return 0;
				}
			}
			function displayResult(result) {
				alert(&quot;Result: &quot; + result + &quot; ms.&quot;);
			}
			// --&gt;
		&lt;/script&gt;
	&lt;/head&gt;
	&lt;body&gt;
		&lt;form action=&quot;&quot;&gt;
			&lt;p&gt;
				&lt;input type=&quot;button&quot; value=&quot;Start&quot; onclick=&quot;testStart()&quot; /&gt;
			&lt;/p&gt;
		&lt;/form&gt;
	&lt;/body&gt;
&lt;/html&gt;
</pre>
<h2>JavaScript Speed Test Results</h2>
<p>There were differences from PC to PC as with the other tests, but the tendency stayed the same. The time of completion of the tasks in Chrome was about six times faster than IE. This was the smallest advantage the Google browser had compared to the tests that were run so far, but it sounds pretty prestige for Chrome to have such a boost in performance for a really small task.</p>
<p>In conclusion, we can say that Google Chrome has set new standards for speed as far as JavaScript is concerned. Although the advantage the browser has might not be as big as Google claim in their advertising campaigns, it is something very impressive and gives the users additional speed for simple everyday tasks as we saw in the example above. We are looking forward to see the ninth version of Internet Explorer soon, as in the early discussions the developers show ambition to reach the level of performance that Chrome already has. The acceleration of the JavaScript engines for all the browsers can only bring benefits to users and contribute to the creation of richer, more complex Internet applications.</p>
]]></content:encoded>
			<wfw:commentRss>http://mentormate.com/blog/google-chrome-browser-faster-internet-explorer-javascript-performance/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
