<?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: Some more JavaScript performance tips</title>
	<atom:link href="http://ajaxian.com/archives/some-more-javascript-performance-tips/feed" rel="self" type="application/rss+xml" />
	<link>http://ajaxian.com/archives/some-more-javascript-performance-tips</link>
	<description>Cleaning up the web with Ajax</description>
	<lastBuildDate>Thu, 17 May 2012 07:43:39 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
	<item>
		<title>By: indiehead</title>
		<link>http://ajaxian.com/archives/some-more-javascript-performance-tips/comment-page-1#comment-263983</link>
		<dc:creator>indiehead</dc:creator>
		<pubDate>Wed, 21 May 2008 10:23:55 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/archives/some-more-javascript-performance-tips#comment-263983</guid>
		<description>thanks for posting this and commenting, appreciate your input a lot guys.

John.</description>
		<content:encoded><![CDATA[<p>thanks for posting this and commenting, appreciate your input a lot guys.</p>
<p>John.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: cwolves</title>
		<link>http://ajaxian.com/archives/some-more-javascript-performance-tips/comment-page-1#comment-263949</link>
		<dc:creator>cwolves</dc:creator>
		<pubDate>Mon, 19 May 2008 18:41:35 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/archives/some-more-javascript-performance-tips#comment-263949</guid>
		<description>@jdalton -

In regards to cloneNode, I used to think the same thing...then I tested it.  cloneNode on a cache object inside a function is slower than createElement due to the overhead of the function call &amp; the object hash lookup.  Prototype -may- be getting a bit of a speed bump by using coneNode in new Element() since the function call has already been done, but that speed gain is -very- small and is greatly trumped by the overhead of the rest of the function.  In general what I&#039;ve realized is that cloneNode on a SINGLE node is almost never worth it (as of IE7, Safari3, FF2)</description>
		<content:encoded><![CDATA[<p>@jdalton -</p>
<p>In regards to cloneNode, I used to think the same thing&#8230;then I tested it.  cloneNode on a cache object inside a function is slower than createElement due to the overhead of the function call &amp; the object hash lookup.  Prototype -may- be getting a bit of a speed bump by using coneNode in new Element() since the function call has already been done, but that speed gain is -very- small and is greatly trumped by the overhead of the rest of the function.  In general what I&#8217;ve realized is that cloneNode on a SINGLE node is almost never worth it (as of IE7, Safari3, FF2)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: digitalIchi</title>
		<link>http://ajaxian.com/archives/some-more-javascript-performance-tips/comment-page-1#comment-263948</link>
		<dc:creator>digitalIchi</dc:creator>
		<pubDate>Mon, 19 May 2008 18:28:00 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/archives/some-more-javascript-performance-tips#comment-263948</guid>
		<description>You can checkout this application I put together to see how different calls in JavaScript perform on different browsers.

http://www.rockstarapps.com/samples/performance/</description>
		<content:encoded><![CDATA[<p>You can checkout this application I put together to see how different calls in JavaScript perform on different browsers.</p>
<p><a href="http://www.rockstarapps.com/samples/performance/" rel="nofollow">http://www.rockstarapps.com/samples/performance/</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: uize</title>
		<link>http://ajaxian.com/archives/some-more-javascript-performance-tips/comment-page-1#comment-263947</link>
		<dc:creator>uize</dc:creator>
		<pubDate>Mon, 19 May 2008 16:10:37 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/archives/some-more-javascript-performance-tips#comment-263947</guid>
		<description>On the string concatenation point, Firefox is well optimized for building large strings using +=, while IE is most decidely not. When building large strings (like serializing JSON, XML, or building HTML for a widget), Array.join is the clear winner in IE for building large strings, while it&#039;s mostly a wash in FF (see http://www.uize.com/tests/performance/string-concatenation-approaches.html)</description>
		<content:encoded><![CDATA[<p>On the string concatenation point, Firefox is well optimized for building large strings using +=, while IE is most decidely not. When building large strings (like serializing JSON, XML, or building HTML for a widget), Array.join is the clear winner in IE for building large strings, while it&#8217;s mostly a wash in FF (see <a href="http://www.uize.com/tests/performance/string-concatenation-approaches.html" rel="nofollow">http://www.uize.com/tests/performance/string-concatenation-approaches.html</a>)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: uize</title>
		<link>http://ajaxian.com/archives/some-more-javascript-performance-tips/comment-page-1#comment-263946</link>
		<dc:creator>uize</dc:creator>
		<pubDate>Mon, 19 May 2008 16:02:47 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/archives/some-more-javascript-performance-tips#comment-263946</guid>
		<description>1) In the UIZE Framework, the Uize.Node.injectHtml static method also deals with evaluating the otherwise crippled scripts, and provides six injection modes: &quot;inner bottom&quot;, &quot;inner top&quot;, &quot;outer bottom&quot;, &quot;outer top&quot;, &quot;inner replace&quot;, and &quot;outer replace&quot;.

2) On the speed of for...in iteration for arrays, don&#039;t use for...in for array iteration. It&#039;s EEEEEEEEVILLLLL! Running a counter with an iterator variable is vastly more efficient. There are times when it&#039;s worth reducing code size by a few characters, and there are times when it&#039;s not. (see http://www.uize.com/tests/performance/array-iteration-styles.html)

3) For additional performance with the counter approach to array iteration, storing the value of the .length property in a local variable also helps (as long as the array will not be modified in length during the operation). Repeated dereferencing of the length property of the array object costs a bit.</description>
		<content:encoded><![CDATA[<p>1) In the UIZE Framework, the Uize.Node.injectHtml static method also deals with evaluating the otherwise crippled scripts, and provides six injection modes: &#8220;inner bottom&#8221;, &#8220;inner top&#8221;, &#8220;outer bottom&#8221;, &#8220;outer top&#8221;, &#8220;inner replace&#8221;, and &#8220;outer replace&#8221;.</p>
<p>2) On the speed of for&#8230;in iteration for arrays, don&#8217;t use for&#8230;in for array iteration. It&#8217;s EEEEEEEEVILLLLL! Running a counter with an iterator variable is vastly more efficient. There are times when it&#8217;s worth reducing code size by a few characters, and there are times when it&#8217;s not. (see <a href="http://www.uize.com/tests/performance/array-iteration-styles.html" rel="nofollow">http://www.uize.com/tests/performance/array-iteration-styles.html</a>)</p>
<p>3) For additional performance with the counter approach to array iteration, storing the value of the .length property in a local variable also helps (as long as the array will not be modified in length during the operation). Repeated dereferencing of the length property of the array object costs a bit.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: howardrauscher</title>
		<link>http://ajaxian.com/archives/some-more-javascript-performance-tips/comment-page-1#comment-263945</link>
		<dc:creator>howardrauscher</dc:creator>
		<pubDate>Mon, 19 May 2008 15:13:16 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/archives/some-more-javascript-performance-tips#comment-263945</guid>
		<description>@ttrenka

Array.join is a lot faster on IE6 that is why it is used.  But as as IE6 share decreases, javascript developers should take note and update their code accordingly.  Otherwise people will continue to do it for no reason.  It&#039;s kind of like how a lot of javascript developers still put a html comment inside of there script tags still.  There is no reason to do it anymore.</description>
		<content:encoded><![CDATA[<p>@ttrenka</p>
<p>Array.join is a lot faster on IE6 that is why it is used.  But as as IE6 share decreases, javascript developers should take note and update their code accordingly.  Otherwise people will continue to do it for no reason.  It&#8217;s kind of like how a lot of javascript developers still put a html comment inside of there script tags still.  There is no reason to do it anymore.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ttrenka</title>
		<link>http://ajaxian.com/archives/some-more-javascript-performance-tips/comment-page-1#comment-263943</link>
		<dc:creator>ttrenka</dc:creator>
		<pubDate>Mon, 19 May 2008 14:16:29 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/archives/some-more-javascript-performance-tips#comment-263943</guid>
		<description>Echoing Dion&#039;s subtle hint:

http://www.sitepen.com/blog/wp-content/uploads/2008/05/stringfor.png

Specifically at the core advice &quot;Use Array.join instead of += on a string&quot; was directly contradicted by the data I collected during the string performance analysis I wrote about; the link above shows clearly that += beats out both using Array.join and String.prototype.concat on all major browsers.</description>
		<content:encoded><![CDATA[<p>Echoing Dion&#8217;s subtle hint:</p>
<p><a href="http://www.sitepen.com/blog/wp-content/uploads/2008/05/stringfor.png" rel="nofollow">http://www.sitepen.com/blog/wp-content/uploads/2008/05/stringfor.png</a></p>
<p>Specifically at the core advice &#8220;Use Array.join instead of += on a string&#8221; was directly contradicted by the data I collected during the string performance analysis I wrote about; the link above shows clearly that += beats out both using Array.join and String.prototype.concat on all major browsers.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sentientholon</title>
		<link>http://ajaxian.com/archives/some-more-javascript-performance-tips/comment-page-1#comment-263942</link>
		<dc:creator>sentientholon</dc:creator>
		<pubDate>Mon, 19 May 2008 13:47:35 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/archives/some-more-javascript-performance-tips#comment-263942</guid>
		<description>Element#update() also evaluates scripts that are injected into the document, that would otherwise be ignored by setting innerHTML.</description>
		<content:encoded><![CDATA[<p>Element#update() also evaluates scripts that are injected into the document, that would otherwise be ignored by setting innerHTML.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Snowcoredotnet</title>
		<link>http://ajaxian.com/archives/some-more-javascript-performance-tips/comment-page-1#comment-263941</link>
		<dc:creator>Snowcoredotnet</dc:creator>
		<pubDate>Mon, 19 May 2008 13:23:01 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/archives/some-more-javascript-performance-tips#comment-263941</guid>
		<description>Yes, innerHTML is dangerous issue (for the performance)</description>
		<content:encoded><![CDATA[<p>Yes, innerHTML is dangerous issue (for the performance)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jdalton</title>
		<link>http://ajaxian.com/archives/some-more-javascript-performance-tips/comment-page-1#comment-263940</link>
		<dc:creator>jdalton</dc:creator>
		<pubDate>Mon, 19 May 2008 13:07:12 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/archives/some-more-javascript-performance-tips#comment-263940</guid>
		<description>Also you can try using the &quot;_each&quot; method on arrays instead of the &quot;each&quot; to avoid the use of the try catch and setting the context.
-JDD</description>
		<content:encoded><![CDATA[<p>Also you can try using the &#8220;_each&#8221; method on arrays instead of the &#8220;each&#8221; to avoid the use of the try catch and setting the context.<br />
-JDD</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jdalton</title>
		<link>http://ajaxian.com/archives/some-more-javascript-performance-tips/comment-page-1#comment-263939</link>
		<dc:creator>jdalton</dc:creator>
		<pubDate>Mon, 19 May 2008 12:56:41 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/archives/some-more-javascript-performance-tips#comment-263939</guid>
		<description>Also Prototype&#039;s new Element(&#039;div&#039;) should be faster than Element.extend(document.createElement(&#039;div&#039;)) because it uses cloneNode().
- JDD</description>
		<content:encoded><![CDATA[<p>Also Prototype&#8217;s new Element(&#8216;div&#8217;) should be faster than Element.extend(document.createElement(&#8216;div&#8217;)) because it uses cloneNode().<br />
- JDD</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jdalton</title>
		<link>http://ajaxian.com/archives/some-more-javascript-performance-tips/comment-page-1#comment-263938</link>
		<dc:creator>jdalton</dc:creator>
		<pubDate>Mon, 19 May 2008 12:54:45 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/archives/some-more-javascript-performance-tips#comment-263938</guid>
		<description>I would also warn about using innerHTML. Prototype&#039;s Element#update method isn&#039;t a straight pointer to innerHTML. It fixes a lot of cross-browser issues. Be sure you are not using innerHTML with elements like tables or some other situations because IE and Opera have problems with them.

- JDD</description>
		<content:encoded><![CDATA[<p>I would also warn about using innerHTML. Prototype&#8217;s Element#update method isn&#8217;t a straight pointer to innerHTML. It fixes a lot of cross-browser issues. Be sure you are not using innerHTML with elements like tables or some other situations because IE and Opera have problems with them.</p>
<p>- JDD</p>
]]></content:encoded>
	</item>
</channel>
</rss>

