<?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: Loop Benchmarks</title>
	<atom:link href="http://lifesinger.org/blog/2009/09/loop-benchmarks/feed/" rel="self" type="application/rss+xml" />
	<link>http://lifesinger.org/blog/2009/09/loop-benchmarks/</link>
	<description>关注用户体验、前端开发，记录生活点滴、岁月足迹。</description>
	<lastBuildDate>Wed, 08 Sep 2010 15:14:32 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
	<item>
		<title>By: 桑拿院的小伙子</title>
		<link>http://lifesinger.org/blog/2009/09/loop-benchmarks/comment-page-1/#comment-2851</link>
		<dc:creator>桑拿院的小伙子</dc:creator>
		<pubDate>Wed, 30 Sep 2009 02:13:24 +0000</pubDate>
		<guid isPermaLink="false">http://lifesinger.org/blog/?p=2203#comment-2851</guid>
		<description>不知道 啥原因，我的opera 10.0居然那么慢，通常都是200多ms，其他浏览器正常</description>
		<content:encoded><![CDATA[<p>不知道 啥原因，我的opera 10.0居然那么慢，通常都是200多ms，其他浏览器正常</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: zsj</title>
		<link>http://lifesinger.org/blog/2009/09/loop-benchmarks/comment-page-1/#comment-2847</link>
		<dc:creator>zsj</dc:creator>
		<pubDate>Tue, 29 Sep 2009 16:59:15 +0000</pubDate>
		<guid isPermaLink="false">http://lifesinger.org/blog/?p=2203#comment-2847</guid>
		<description>擂主辛苦。“原因可以回溯到汇编语言”这句过了。10楼靠谱。</description>
		<content:encoded><![CDATA[<p>擂主辛苦。“原因可以回溯到汇编语言”这句过了。10楼靠谱。</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: zhouyao</title>
		<link>http://lifesinger.org/blog/2009/09/loop-benchmarks/comment-page-1/#comment-2823</link>
		<dc:creator>zhouyao</dc:creator>
		<pubDate>Tue, 29 Sep 2009 04:26:13 +0000</pubDate>
		<guid isPermaLink="false">http://lifesinger.org/blog/?p=2203#comment-2823</guid>
		<description>jQuery中
inArray: function( elem, array ) {
		for ( var i = 0, length = array.length; i &lt; length; i++ )
		// Use === because on IE, window == document
			if ( array[ i ] === elem )
				return i;

		return -1;
	},</description>
		<content:encoded><![CDATA[<p>jQuery中<br />
inArray: function( elem, array ) {<br />
		for ( var i = 0, length = array.length; i &lt; length; i++ )<br />
		// Use === because on IE, window == document<br />
			if ( array[ i ] === elem )<br />
				return i;</p>
<p>		return -1;<br />
	},</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: 打酱油的</title>
		<link>http://lifesinger.org/blog/2009/09/loop-benchmarks/comment-page-1/#comment-2768</link>
		<dc:creator>打酱油的</dc:creator>
		<pubDate>Sat, 26 Sep 2009 13:50:47 +0000</pubDate>
		<guid isPermaLink="false">http://lifesinger.org/blog/?p=2203#comment-2768</guid>
		<description>哈哈看反了
++i &lt; i++ &lt; i = i + 1 &lt; i += 1
以为小于号是指效率，我说怎么就想不通呢</description>
		<content:encoded><![CDATA[<p>哈哈看反了<br />
++i &lt; i++ &lt; i = i + 1 &lt; i += 1<br />
以为小于号是指效率，我说怎么就想不通呢</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: lifesinger</title>
		<link>http://lifesinger.org/blog/2009/09/loop-benchmarks/comment-page-1/#comment-2763</link>
		<dc:creator>lifesinger</dc:creator>
		<pubDate>Sat, 26 Sep 2009 06:41:50 +0000</pubDate>
		<guid isPermaLink="false">http://lifesinger.org/blog/?p=2203#comment-2763</guid>
		<description>@ls: 
1. 可以参考 http://bbs.51js.com/viewthread.php?tid=84235

2. 同意

3. 非常同意

推荐一本书《Even.Faster.Websites》，这些才是优化的主要方向。</description>
		<content:encoded><![CDATA[<p>@ls:<br />
1. 可以参考 <a href="http://bbs.51js.com/viewthread.php?tid=84235" rel="nofollow">http://bbs.51js.com/viewthread.php?tid=84235</a></p>
<p>2. 同意</p>
<p>3. 非常同意</p>
<p>推荐一本书《Even.Faster.Websites》，这些才是优化的主要方向。</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: 打酱油的</title>
		<link>http://lifesinger.org/blog/2009/09/loop-benchmarks/comment-page-1/#comment-2762</link>
		<dc:creator>打酱油的</dc:creator>
		<pubDate>Sat, 26 Sep 2009 05:50:40 +0000</pubDate>
		<guid isPermaLink="false">http://lifesinger.org/blog/?p=2203#comment-2762</guid>
		<description>1. ++i &lt; i++ &lt; i = i + 1 &lt; i += 1. 原因可以回溯到汇编语言。 这个不太明白，回溯到汇编的话，我会看的也就两个方面：一是看指令，编译器没有道理把i += 1整成INC而把++i整成ADD；二是看内存操作还是寄存器操作（当然最终计算都要进寄存器的，内存不过是多了来回倒腾），我也看不出为i += 1的i分配成寄存而把++i的i放内存里的理由。还望赐教。
2.  现实的问题是，我们通常说的javascript，多在操作DOM。一次多余的或不当的DOM操作，就足以抵消对javascript语言细节上的十次优化。网上说到javascript，总是跟DOM联系在一起的（有很多人甚至以为alert是javascript的内置函数），但是说到前端脚本的优化，却从来只谈javascript的奇技淫巧——当然到了最后，拼的就是细节，但我以为目前国内前端开发的整体水平以及需求，都还远远不到那个层次，掌握话语权的同志们动辄循环和汇编，往往不经意将广大民众引入歧途。
3.  回到程序设计本身，算法才是王道，真正不可接受的耗时是重复计算。比如朴素的菲波拉契数递归算法：function fib(n){return n &lt; 2 ? 1 : fib(n - 1) + fib(n - 2)}，即使换作C语言，fib(100)也得算上若干年。</description>
		<content:encoded><![CDATA[<p>1. ++i &lt; i++ &lt; i = i + 1 &lt; i += 1. 原因可以回溯到汇编语言。 这个不太明白，回溯到汇编的话，我会看的也就两个方面：一是看指令，编译器没有道理把i += 1整成INC而把++i整成ADD；二是看内存操作还是寄存器操作（当然最终计算都要进寄存器的，内存不过是多了来回倒腾），我也看不出为i += 1的i分配成寄存而把++i的i放内存里的理由。还望赐教。<br />
2.  现实的问题是，我们通常说的javascript，多在操作DOM。一次多余的或不当的DOM操作，就足以抵消对javascript语言细节上的十次优化。网上说到javascript，总是跟DOM联系在一起的（有很多人甚至以为alert是javascript的内置函数），但是说到前端脚本的优化，却从来只谈javascript的奇技淫巧——当然到了最后，拼的就是细节，但我以为目前国内前端开发的整体水平以及需求，都还远远不到那个层次，掌握话语权的同志们动辄循环和汇编，往往不经意将广大民众引入歧途。<br />
3.  回到程序设计本身，算法才是王道，真正不可接受的耗时是重复计算。比如朴素的菲波拉契数递归算法：function fib(n){return n &lt; 2 ? 1 : fib(n &#8211; 1) + fib(n &#8211; 2)}，即使换作C语言，fib(100)也得算上若干年。</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: countmeon</title>
		<link>http://lifesinger.org/blog/2009/09/loop-benchmarks/comment-page-1/#comment-2731</link>
		<dc:creator>countmeon</dc:creator>
		<pubDate>Wed, 23 Sep 2009 08:15:24 +0000</pubDate>
		<guid isPermaLink="false">http://lifesinger.org/blog/?p=2203#comment-2731</guid>
		<description>做前端辛苦吗？</description>
		<content:encoded><![CDATA[<p>做前端辛苦吗？</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: 摇滚肉包子</title>
		<link>http://lifesinger.org/blog/2009/09/loop-benchmarks/comment-page-1/#comment-2729</link>
		<dc:creator>摇滚肉包子</dc:creator>
		<pubDate>Wed, 23 Sep 2009 04:34:50 +0000</pubDate>
		<guid isPermaLink="false">http://lifesinger.org/blog/?p=2203#comment-2729</guid>
		<description>正好时间在整理总结关于Javascript性能优化的文章，关于循环方面缺乏足够的测试，雕兄这篇文章真是完美。

http://www.fangyuqiang.com/archives/417</description>
		<content:encoded><![CDATA[<p>正好时间在整理总结关于Javascript性能优化的文章，关于循环方面缺乏足够的测试，雕兄这篇文章真是完美。</p>
<p><a href="http://www.fangyuqiang.com/archives/417" rel="nofollow">http://www.fangyuqiang.com/archives/417</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: army8735</title>
		<link>http://lifesinger.org/blog/2009/09/loop-benchmarks/comment-page-1/#comment-2719</link>
		<dc:creator>army8735</dc:creator>
		<pubDate>Tue, 22 Sep 2009 09:09:07 +0000</pubDate>
		<guid isPermaLink="false">http://lifesinger.org/blog/?p=2203#comment-2719</guid>
		<description>记得有人测试过i+=1较之i++有着微弱的性能优势，不过写着很是不爽，还多一个字符。</description>
		<content:encoded><![CDATA[<p>记得有人测试过i+=1较之i++有着微弱的性能优势，不过写着很是不爽，还多一个字符。</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: anyLiv</title>
		<link>http://lifesinger.org/blog/2009/09/loop-benchmarks/comment-page-1/#comment-2682</link>
		<dc:creator>anyLiv</dc:creator>
		<pubDate>Sat, 19 Sep 2009 10:16:05 +0000</pubDate>
		<guid isPermaLink="false">http://lifesinger.org/blog/?p=2203#comment-2682</guid>
		<description>Webkit 感觉明显比其它核心快……</description>
		<content:encoded><![CDATA[<p>Webkit 感觉明显比其它核心快……</p>
]]></content:encoded>
	</item>
</channel>
</rss>
