<?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: Speeding up your JavaScript: Part 3 and 4</title>
	<atom:link href="http://ajaxian.com/archives/speedyjs34/feed" rel="self" type="application/rss+xml" />
	<link>http://ajaxian.com/archives/speedyjs34</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: jaysmith</title>
		<link>http://ajaxian.com/archives/speedyjs34/comment-page-1#comment-271169</link>
		<dc:creator>jaysmith</dc:creator>
		<pubDate>Fri, 06 Feb 2009 14:42:59 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=5884#comment-271169</guid>
		<description>Could we also assign innerHTML strings to a DocumentFragment? If so, do we still get a better preformance?</description>
		<content:encoded><![CDATA[<p>Could we also assign innerHTML strings to a DocumentFragment? If so, do we still get a better preformance?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: WebReflection</title>
		<link>http://ajaxian.com/archives/speedyjs34/comment-page-1#comment-271141</link>
		<dc:creator>WebReflection</dc:creator>
		<pubDate>Thu, 05 Feb 2009 11:42:42 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=5884#comment-271141</guid>
		<description>ehr ... ok, I guess the shell arguments is necessary, sorry :D</description>
		<content:encoded><![CDATA[<p>ehr &#8230; ok, I guess the shell arguments is necessary, sorry :D</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: WebReflection</title>
		<link>http://ajaxian.com/archives/speedyjs34/comment-page-1#comment-271140</link>
		<dc:creator>WebReflection</dc:creator>
		<pubDate>Thu, 05 Feb 2009 11:39:01 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/?p=5884#comment-271140</guid>
		<description>The &quot;in&quot; check unfortunately is not that reliable ... as you said this is perfect for fibonacci stuff but with object or different results there are a couple of problems ... 
&lt;code&gt;var o = {&quot;a&quot;:true};
var a = {toString:function(){return &quot;a&quot;}};
alert(a in o);&lt;/code&gt;
In my opinione the best cache scenario is a stack with usage of Array.prototype.indexOf but latter method is still not present in every IE and for this reason it slows down stack based cache object (it always depends how many results we expect in every case)

btw, performances uh? so use ternary ;-) - and I think the shell as argument is not necessary as well ... 
&lt;code&gt;function memoizer(fundamental, cache){
    cache = cache &#124;&#124; {};
    return function(arg){
        return arg in cache ?
            cache[arg] :
            (cache[arg] = fundamental(arg))
        ;
    };
};&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>The &#8220;in&#8221; check unfortunately is not that reliable &#8230; as you said this is perfect for fibonacci stuff but with object or different results there are a couple of problems &#8230;<br />
<code>var o = {"a":true};<br />
var a = {toString:function(){return "a"}};<br />
alert(a in o);</code><br />
In my opinione the best cache scenario is a stack with usage of Array.prototype.indexOf but latter method is still not present in every IE and for this reason it slows down stack based cache object (it always depends how many results we expect in every case)</p>
<p>btw, performances uh? so use ternary ;-) &#8211; and I think the shell as argument is not necessary as well &#8230;<br />
<code>function memoizer(fundamental, cache){<br />
    cache = cache || {};<br />
    return function(arg){<br />
        return arg in cache ?<br />
            cache[arg] :<br />
            (cache[arg] = fundamental(arg))<br />
        ;<br />
    };<br />
};</code></p>
]]></content:encoded>
	</item>
</channel>
</rss>

