<?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: Don&#8217;t use Number to iterate over for-loops</title>
	<atom:link href="http://jacwright.com/blog/77/dont-use-number-to-iterate-over-for-loops/feed/" rel="self" type="application/rss+xml" />
	<link>http://jacwright.com/blog/77/dont-use-number-to-iterate-over-for-loops/</link>
	<description>Flex, AIR, PHP, etc.</description>
	<lastBuildDate>Thu, 26 Aug 2010 22:38:43 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
	<item>
		<title>By: Joel Berghoff</title>
		<link>http://jacwright.com/blog/77/dont-use-number-to-iterate-over-for-loops/comment-page-1/#comment-8410</link>
		<dc:creator>Joel Berghoff</dc:creator>
		<pubDate>Sun, 14 Jun 2009 18:07:17 +0000</pubDate>
		<guid isPermaLink="false">http://jacwright.com/blog/77/dont-use-number-to-iterate-over-for-loops/#comment-8410</guid>
		<description>I get slightly better results still if I use a prefix operator in the for-statement:
 for (var i:uint = 0; i &lt; length; ++i)

Is there a reason more people don&#039;t do this?</description>
		<content:encoded><![CDATA[<p>I get slightly better results still if I use a prefix operator in the for-statement:<br />
 for (var i:uint = 0; i &lt; length; ++i)</p>
<p>Is there a reason more people don&#8217;t do this?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jacob Wright</title>
		<link>http://jacwright.com/blog/77/dont-use-number-to-iterate-over-for-loops/comment-page-1/#comment-8034</link>
		<dc:creator>Jacob Wright</dc:creator>
		<pubDate>Tue, 12 Aug 2008 22:51:44 +0000</pubDate>
		<guid isPermaLink="false">http://jacwright.com/blog/77/dont-use-number-to-iterate-over-for-loops/#comment-8034</guid>
		<description>Declaring a variable inside your loop statement or outside result in the same visibility and variable type. You wouldn&#039;t get any performance gain doing it that way.</description>
		<content:encoded><![CDATA[<p>Declaring a variable inside your loop statement or outside result in the same visibility and variable type. You wouldn&#8217;t get any performance gain doing it that way.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jwopitz</title>
		<link>http://jacwright.com/blog/77/dont-use-number-to-iterate-over-for-loops/comment-page-1/#comment-8017</link>
		<dc:creator>jwopitz</dc:creator>
		<pubDate>Wed, 30 Jul 2008 16:36:51 +0000</pubDate>
		<guid isPermaLink="false">http://jacwright.com/blog/77/dont-use-number-to-iterate-over-for-loops/#comment-8017</guid>
		<description>what kind of results would you get if you were to optimize further by saying this:

var i:uint;
var m:uint = someArray.length;
for (i; i &lt; m; i++)
{ ... }

I know that doesn&#039;t remotely sound like a huge difference but I wonder if by establishing your variables outside the for loop if you get any further performance increases.</description>
		<content:encoded><![CDATA[<p>what kind of results would you get if you were to optimize further by saying this:</p>
<p>var i:uint;<br />
var m:uint = someArray.length;<br />
for (i; i &lt; m; i++)<br />
{ &#8230; }</p>
<p>I know that doesn&#8217;t remotely sound like a huge difference but I wonder if by establishing your variables outside the for loop if you get any further performance increases.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Keith Gaddis</title>
		<link>http://jacwright.com/blog/77/dont-use-number-to-iterate-over-for-loops/comment-page-1/#comment-7820</link>
		<dc:creator>Keith Gaddis</dc:creator>
		<pubDate>Thu, 24 Apr 2008 04:16:58 +0000</pubDate>
		<guid isPermaLink="false">http://jacwright.com/blog/77/dont-use-number-to-iterate-over-for-loops/#comment-7820</guid>
		<description>Bjarne Stroustrop used to say, &quot;Premature optimization is the root of all evil.&quot; I&#039;m not sure in common use that the difference would be THAT significant, but all the same, good information to have!</description>
		<content:encoded><![CDATA[<p>Bjarne Stroustrop used to say, &#8220;Premature optimization is the root of all evil.&#8221; I&#8217;m not sure in common use that the difference would be THAT significant, but all the same, good information to have!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jacob Wright</title>
		<link>http://jacwright.com/blog/77/dont-use-number-to-iterate-over-for-loops/comment-page-1/#comment-7771</link>
		<dc:creator>Jacob Wright</dc:creator>
		<pubDate>Mon, 31 Mar 2008 16:59:26 +0000</pubDate>
		<guid isPermaLink="false">http://jacwright.com/blog/77/dont-use-number-to-iterate-over-for-loops/#comment-7771</guid>
		<description>The proof out there was what I linked to in the post. They were loops that were doing mathematical operations with the &quot;i&quot; variable. Using Number was faster in that scenario. This is less common then simply iterating over a loop.

I found that uint is ever-so-slightly faster than int and much faster than Number if you are simply iterating over a loop.</description>
		<content:encoded><![CDATA[<p>The proof out there was what I linked to in the post. They were loops that were doing mathematical operations with the &#8220;i&#8221; variable. Using Number was faster in that scenario. This is less common then simply iterating over a loop.</p>
<p>I found that uint is ever-so-slightly faster than int and much faster than Number if you are simply iterating over a loop.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jon Valliere</title>
		<link>http://jacwright.com/blog/77/dont-use-number-to-iterate-over-for-loops/comment-page-1/#comment-7748</link>
		<dc:creator>Jon Valliere</dc:creator>
		<pubDate>Tue, 25 Mar 2008 21:05:07 +0000</pubDate>
		<guid isPermaLink="false">http://jacwright.com/blog/77/dont-use-number-to-iterate-over-for-loops/#comment-7748</guid>
		<description>I also believe there is some proof out there that &#039;uint&#039; is actually slower than &#039;int&#039; for &quot;for/while&quot; iterations.</description>
		<content:encoded><![CDATA[<p>I also believe there is some proof out there that &#8216;uint&#8217; is actually slower than &#8216;int&#8217; for &#8220;for/while&#8221; iterations.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andrew</title>
		<link>http://jacwright.com/blog/77/dont-use-number-to-iterate-over-for-loops/comment-page-1/#comment-7737</link>
		<dc:creator>Andrew</dc:creator>
		<pubDate>Thu, 20 Mar 2008 04:46:09 +0000</pubDate>
		<guid isPermaLink="false">http://jacwright.com/blog/77/dont-use-number-to-iterate-over-for-loops/#comment-7737</guid>
		<description>That&#039;s funny. I was just wondering today which would be faster to use for iterating through arrays. I guess I guessed wrong.</description>
		<content:encoded><![CDATA[<p>That&#8217;s funny. I was just wondering today which would be faster to use for iterating through arrays. I guess I guessed wrong.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
