<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Investigating JavaScript Array Iteration Performance</title>
	<atom:link href="http://benhollis.net/blog/2009/12/13/investigating-javascript-array-iteration-performance/feed/" rel="self" type="application/rss+xml" />
	<link>http://benhollis.net/blog/2009/12/13/investigating-javascript-array-iteration-performance/</link>
	<description>News about BenHollis.net and articles about Ben&#039;s interests</description>
	<lastBuildDate>Fri, 03 Sep 2010 02:00:35 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
	<item>
		<title>By: Yet Another JavaScript Blog &#187; Google Summer of Code 2010, Final Update</title>
		<link>http://benhollis.net/blog/2009/12/13/investigating-javascript-array-iteration-performance/comment-page-1/#comment-9749</link>
		<dc:creator>Yet Another JavaScript Blog &#187; Google Summer of Code 2010, Final Update</dc:creator>
		<pubDate>Mon, 16 Aug 2010 20:23:30 +0000</pubDate>
		<guid isPermaLink="false">http://brh.numbera.com/blog/?p=390#comment-9749</guid>
		<description>[...] and augmenting Array.prototype for compatibility with Internet Explorer. However, these methods are often slower than using a regular for loop, especially in IE, and so it would be good to swap them [...]</description>
		<content:encoded><![CDATA[<p>[...] and augmenting Array.prototype for compatibility with Internet Explorer. However, these methods are often slower than using a regular for loop, especially in IE, and so it would be good to swap them [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Diego Perini</title>
		<link>http://benhollis.net/blog/2009/12/13/investigating-javascript-array-iteration-performance/comment-page-1/#comment-9688</link>
		<dc:creator>Diego Perini</dc:creator>
		<pubDate>Wed, 23 Jun 2010 15:08:27 +0000</pubDate>
		<guid isPermaLink="false">http://brh.numbera.com/blog/?p=390#comment-9688</guid>
		<description>Nice and extensive review of iterators speed and available alternatives.

As you pointed out the slowdown is due to calling a function for each iteration. This seems to be one of the most expensive operation for a browser since it has to save the current stack/scope and retrieve it back on each function return.

That&#039;s pretty easy to understand. And since loops are used for everything from animation to DOM manipulation using the best alternative will give us a generic overall boost in our applications. The gain is so big that cannot be left out.

John David Dalton (of FuesJS) have setup an interesting speed demo related to this:

http://dl.dropbox.com/u/513327/loop_speed/index.html

have a look and see what we have been missing :)</description>
		<content:encoded><![CDATA[<p>Nice and extensive review of iterators speed and available alternatives.</p>
<p>As you pointed out the slowdown is due to calling a function for each iteration. This seems to be one of the most expensive operation for a browser since it has to save the current stack/scope and retrieve it back on each function return.</p>
<p>That&#8217;s pretty easy to understand. And since loops are used for everything from animation to DOM manipulation using the best alternative will give us a generic overall boost in our applications. The gain is so big that cannot be left out.</p>
<p>John David Dalton (of FuesJS) have setup an interesting speed demo related to this:</p>
<p><a href="http://dl.dropbox.com/u/513327/loop_speed/index.html" rel="nofollow">http://dl.dropbox.com/u/513327/loop_speed/index.html</a></p>
<p>have a look and see what we have been missing :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Colin</title>
		<link>http://benhollis.net/blog/2009/12/13/investigating-javascript-array-iteration-performance/comment-page-1/#comment-9481</link>
		<dc:creator>Colin</dc:creator>
		<pubDate>Fri, 19 Mar 2010 23:16:39 +0000</pubDate>
		<guid isPermaLink="false">http://brh.numbera.com/blog/?p=390#comment-9481</guid>
		<description>Good article, exactly what I was looking for after I ran into the problem with unhoisted for loops in IE. My problem was much more severe, though. It was taking 7 seconds(!) to iterate over an 8500 item array. I guess the difference was that the items were DOM elements instead of numbers... but I don&#039;t understand why that would change the time taken to get ary.length. In any case, when I put the array length into a variable, the execution time dropped to around 60ms.

Keep in mind that all these differences will be amplified for slower computers, so make sure you&#039;re being efficient on those big loops.</description>
		<content:encoded><![CDATA[<p>Good article, exactly what I was looking for after I ran into the problem with unhoisted for loops in IE. My problem was much more severe, though. It was taking 7 seconds(!) to iterate over an 8500 item array. I guess the difference was that the items were DOM elements instead of numbers&#8230; but I don&#8217;t understand why that would change the time taken to get ary.length. In any case, when I put the array length into a variable, the execution time dropped to around 60ms.</p>
<p>Keep in mind that all these differences will be amplified for slower computers, so make sure you&#8217;re being efficient on those big loops.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jebaird</title>
		<link>http://benhollis.net/blog/2009/12/13/investigating-javascript-array-iteration-performance/comment-page-1/#comment-9446</link>
		<dc:creator>jebaird</dc:creator>
		<pubDate>Fri, 05 Mar 2010 15:49:56 +0000</pubDate>
		<guid isPermaLink="false">http://brh.numbera.com/blog/?p=390#comment-9446</guid>
		<description>Thanks for the good info. I didnt know about Underscore.js or the  _.each method.  I&#039;m checking it out now.

Also, I did notice a small typo, differece should be difference

thanks again</description>
		<content:encoded><![CDATA[<p>Thanks for the good info. I didnt know about Underscore.js or the  _.each method.  I&#8217;m checking it out now.</p>
<p>Also, I did notice a small typo, differece should be difference</p>
<p>thanks again</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Iain</title>
		<link>http://benhollis.net/blog/2009/12/13/investigating-javascript-array-iteration-performance/comment-page-1/#comment-9372</link>
		<dc:creator>Iain</dc:creator>
		<pubDate>Wed, 10 Feb 2010 18:58:06 +0000</pubDate>
		<guid isPermaLink="false">http://brh.numbera.com/blog/?p=390#comment-9372</guid>
		<description>You forgot foreach in, which loops over values, not keys.  Of course, it&#039;s just as bad as for in, in that it will loop over unwanted values.</description>
		<content:encoded><![CDATA[<p>You forgot foreach in, which loops over values, not keys.  Of course, it&#8217;s just as bad as for in, in that it will loop over unwanted values.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
