<?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: JavaScript Performance: for vs. while</title>
	<atom:link href="/2012/01/24/javascript-performance-for-vs-while/feed/" rel="self" type="application/rss+xml" />
	<link>/2012/01/24/javascript-performance-for-vs-while/</link>
	<description>on web development</description>
	<lastBuildDate>Fri, 26 Oct 2018 21:40:18 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=5.0.3</generator>
	<item>
		<title>By: Kenneth</title>
		<link>/2012/01/24/javascript-performance-for-vs-while/comment-page-1/#comment-380463</link>
		<dc:creator><![CDATA[Kenneth]]></dc:creator>
		<pubDate>Sat, 31 Oct 2015 21:14:44 +0000</pubDate>
		<guid isPermaLink="false">/?p=2635#comment-380463</guid>
		<description><![CDATA[This is really mind boggling. I had always believe &quot;While&quot; is the better OPTION but these test proves a probability issue(What&#039;s the chance that the time you used the loop will be the best). Based on this result the best average performance is &quot;While&quot;.  

However,  The number of times &quot;For&quot; performed better is more than the number of times &quot;While&quot; did, especially with that significant &quot;While&quot; spike only occurred once out of ten attempts.

Now that tells me there is a greater chance of having a faster result with &quot;For&quot; than &quot;While&quot;. So while &quot;while&quot; is better on average, I&#039;m now led to believe &quot;For&quot; is the better option.]]></description>
		<content:encoded><![CDATA[<p>This is really mind boggling. I had always believe &#8220;While&#8221; is the better OPTION but these test proves a probability issue(What&#8217;s the chance that the time you used the loop will be the best). Based on this result the best average performance is &#8220;While&#8221;.  </p>
<p>However,  The number of times &#8220;For&#8221; performed better is more than the number of times &#8220;While&#8221; did, especially with that significant &#8220;While&#8221; spike only occurred once out of ten attempts.</p>
<p>Now that tells me there is a greater chance of having a faster result with &#8220;For&#8221; than &#8220;While&#8221;. So while &#8220;while&#8221; is better on average, I&#8217;m now led to believe &#8220;For&#8221; is the better option.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tushar Singh</title>
		<link>/2012/01/24/javascript-performance-for-vs-while/comment-page-1/#comment-18568</link>
		<dc:creator><![CDATA[Tushar Singh]]></dc:creator>
		<pubDate>Thu, 28 Mar 2013 04:24:17 +0000</pubDate>
		<guid isPermaLink="false">/?p=2635#comment-18568</guid>
		<description><![CDATA[I ran 10 tests with 1 billion iterations and the average came out to be this
while: 14566.ms 
for: 16297ms
(rounded figures)

so yea, while really is faster..

P.S change the font on textarea and inputs]]></description>
		<content:encoded><![CDATA[<p>I ran 10 tests with 1 billion iterations and the average came out to be this<br />
while: 14566.ms<br />
for: 16297ms<br />
(rounded figures)</p>
<p>so yea, while really is faster..</p>
<p>P.S change the font on textarea and inputs</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Luca</title>
		<link>/2012/01/24/javascript-performance-for-vs-while/comment-page-1/#comment-15966</link>
		<dc:creator><![CDATA[Luca]]></dc:creator>
		<pubDate>Sat, 09 Jun 2012 20:48:52 +0000</pubDate>
		<guid isPermaLink="false">/?p=2635#comment-15966</guid>
		<description><![CDATA[Can you please try to replace i++ with ++i?]]></description>
		<content:encoded><![CDATA[<p>Can you please try to replace i++ with ++i?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Giovanni</title>
		<link>/2012/01/24/javascript-performance-for-vs-while/comment-page-1/#comment-15106</link>
		<dc:creator><![CDATA[Giovanni]]></dc:creator>
		<pubDate>Fri, 03 Feb 2012 22:31:43 +0000</pubDate>
		<guid isPermaLink="false">/?p=2635#comment-15106</guid>
		<description><![CDATA[First, I have to say that I find the results interesting. Thanks for the research.
That beeing said, I agree with Derrick. Moreover, I think that this should not even be an aspect considered in the optimizazion of the code. I think that there&#039;s always space for algorithmic optimization dealing with computational complexity, first (something much more important to optimize).
Finally, nothing guarantees that this &quot;optimization&quot; will work on every interpreter or on different versions of the same interpreter. 
Interesting, nevertheless.]]></description>
		<content:encoded><![CDATA[<p>First, I have to say that I find the results interesting. Thanks for the research.<br />
That beeing said, I agree with Derrick. Moreover, I think that this should not even be an aspect considered in the optimizazion of the code. I think that there&#8217;s always space for algorithmic optimization dealing with computational complexity, first (something much more important to optimize).<br />
Finally, nothing guarantees that this &#8220;optimization&#8221; will work on every interpreter or on different versions of the same interpreter.<br />
Interesting, nevertheless.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Derrick</title>
		<link>/2012/01/24/javascript-performance-for-vs-while/comment-page-1/#comment-15043</link>
		<dc:creator><![CDATA[Derrick]]></dc:creator>
		<pubDate>Wed, 25 Jan 2012 00:14:04 +0000</pubDate>
		<guid isPermaLink="false">/?p=2635#comment-15043</guid>
		<description><![CDATA[The &#039;extremely&#039; minor performance difference isn&#039;t worth the uglier code.]]></description>
		<content:encoded><![CDATA[<p>The &#8216;extremely&#8217; minor performance difference isn&#8217;t worth the uglier code.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Aleksejs</title>
		<link>/2012/01/24/javascript-performance-for-vs-while/comment-page-1/#comment-15037</link>
		<dc:creator><![CDATA[Aleksejs]]></dc:creator>
		<pubDate>Tue, 24 Jan 2012 14:42:45 +0000</pubDate>
		<guid isPermaLink="false">/?p=2635#comment-15037</guid>
		<description><![CDATA[I think, if you have so diverse results (like 3 times slower &quot;while&quot; in second test), you have some process that disturbs normal testing. Anyway, you need to run not ten but ten million tests to be able to tell an average value properly.]]></description>
		<content:encoded><![CDATA[<p>I think, if you have so diverse results (like 3 times slower &#8220;while&#8221; in second test), you have some process that disturbs normal testing. Anyway, you need to run not ten but ten million tests to be able to tell an average value properly.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
