<?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: Favorite Loop Benchmark</title>
	<atom:link href="http://www.digitalmediaminute.com/article/2099/favorite-loop-benchmark/feed" rel="self" type="application/rss+xml" />
	<link>http://www.digitalmediaminute.com/article/2099/favorite-loop-benchmark</link>
	<description>News that matters for Web Developers</description>
	<lastBuildDate>Sat, 04 Feb 2012 20:26:44 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: Danilo</title>
		<link>http://www.digitalmediaminute.com/article/2099/favorite-loop-benchmark/comment-page-1#comment-3542</link>
		<dc:creator>Danilo</dc:creator>
		<pubDate>Sun, 16 Apr 2006 13:34:53 +0000</pubDate>
		<guid isPermaLink="false">http://www.digitalmediaminute.com/article/2099/favorite-loop-benchmark#comment-3542</guid>
		<description>Unfortunately the loops as shown are not equilivant folks.

Try running the 3rd one with 0, &quot;&quot;, false, or null as any one of the array values instead of the &quot;1 to iterations&quot; integers within the test array, and you&#039;ll find that your looping will not loop around all of the elements in the array, but rather stop at the first ocurance of 0, &quot;&quot;, or null. 

I suppose that if you can guarantee that you&#039;ll only ever have non-0, non-&quot;&quot;, non-false, non-null data in your array you might be able to get away with using this type of construct, but even then, you be giving up guaranteed working for just a few milliseconds. And even at 100,000 iterations (when&#039;s the last time anyone really needed an array that large?), in the worst performing browser, the difference is only 46 milliseconds, which isn&#039;t going to be noticable.</description>
		<content:encoded><![CDATA[<p>Unfortunately the loops as shown are not equilivant folks.</p>
<p>Try running the 3rd one with 0, &#8220;&#8221;, false, or null as any one of the array values instead of the &#8220;1 to iterations&#8221; integers within the test array, and you&#8217;ll find that your looping will not loop around all of the elements in the array, but rather stop at the first ocurance of 0, &#8220;&#8221;, or null. </p>
<p>I suppose that if you can guarantee that you&#8217;ll only ever have non-0, non-&#8221;", non-false, non-null data in your array you might be able to get away with using this type of construct, but even then, you be giving up guaranteed working for just a few milliseconds. And even at 100,000 iterations (when&#8217;s the last time anyone really needed an array that large?), in the worst performing browser, the difference is only 46 milliseconds, which isn&#8217;t going to be noticable.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mike Haugland</title>
		<link>http://www.digitalmediaminute.com/article/2099/favorite-loop-benchmark/comment-page-1#comment-3538</link>
		<dc:creator>Mike Haugland</dc:creator>
		<pubDate>Sun, 16 Apr 2006 01:39:41 +0000</pubDate>
		<guid isPermaLink="false">http://www.digitalmediaminute.com/article/2099/favorite-loop-benchmark#comment-3538</guid>
		<description>Just adding the results of the test for Opera 9.0 weekly build 8367.

1,000 Iterations
---------------------
1. 0ms
2. 0ms
3. 0ms

10,000 Iterations
---------------------
1. 40ms
2. 30ms
3. 30ms

100,000 Iterations
---------------------
1. 340ms
2. 341ms
3. 280ms

Doing the test multiple times resulted in different results, but method 3 was consistently the fastest.</description>
		<content:encoded><![CDATA[<p>Just adding the results of the test for Opera 9.0 weekly build 8367.</p>
<p>1,000 Iterations<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
1. 0ms<br />
2. 0ms<br />
3. 0ms</p>
<p>10,000 Iterations<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
1. 40ms<br />
2. 30ms<br />
3. 30ms</p>
<p>100,000 Iterations<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
1. 340ms<br />
2. 341ms<br />
3. 280ms</p>
<p>Doing the test multiple times resulted in different results, but method 3 was consistently the fastest.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

