<?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: Improving performance with return values caching</title>
	<atom:link href="http://www.jmfeurprier.com/blog/2009/02/04/improving-performance-with-return-values-caching/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.jmfeurprier.com/blog/2009/02/04/improving-performance-with-return-values-caching/</link>
	<description>LAMP Web Developer</description>
	<lastBuildDate>Thu, 26 Aug 2010 08:02:19 -0400</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: David</title>
		<link>http://www.jmfeurprier.com/blog/2009/02/04/improving-performance-with-return-values-caching/comment-page-1/#comment-6</link>
		<dc:creator>David</dc:creator>
		<pubDate>Mon, 16 Feb 2009 03:28:19 +0000</pubDate>
		<guid isPermaLink="false">http://www.jmfeurprier.com/blog/2009/02/04/improving-performance-with-return-values-caching/#comment-6</guid>
		<description>Thistechnique  will only work if the script in question is making many requests to the same function in the lifetime of a single server request.  The function and variable scope only will last the lifetime of the current script.  The next user/request gains no advantage of the caching in your model.

Your better off using memcached, or some sort of shared memory storage if you want to gain caching peformance for typical web application design patterns</description>
		<content:encoded><![CDATA[<p>Thistechnique  will only work if the script in question is making many requests to the same function in the lifetime of a single server request.  The function and variable scope only will last the lifetime of the current script.  The next user/request gains no advantage of the caching in your model.</p>
<p>Your better off using memcached, or some sort of shared memory storage if you want to gain caching peformance for typical web application design patterns</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jean-Michel Feurprier</title>
		<link>http://www.jmfeurprier.com/blog/2009/02/04/improving-performance-with-return-values-caching/comment-page-1/#comment-5</link>
		<dc:creator>Jean-Michel Feurprier</dc:creator>
		<pubDate>Fri, 06 Feb 2009 01:10:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.jmfeurprier.com/blog/2009/02/04/improving-performance-with-return-values-caching/#comment-5</guid>
		<description>Exactly ! I will try to make another post in a near future about more advanced caching techniques.</description>
		<content:encoded><![CDATA[<p>Exactly ! I will try to make another post in a near future about more advanced caching techniques.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jesper Vingborg Andersen</title>
		<link>http://www.jmfeurprier.com/blog/2009/02/04/improving-performance-with-return-values-caching/comment-page-1/#comment-4</link>
		<dc:creator>Jesper Vingborg Andersen</dc:creator>
		<pubDate>Thu, 05 Feb 2009 15:57:13 +0000</pubDate>
		<guid isPermaLink="false">http://www.jmfeurprier.com/blog/2009/02/04/improving-performance-with-return-values-caching/#comment-4</guid>
		<description>Yeah, it is a very neat trick that is used in many projects, such as Drupal. A real lifesaver at times.

It has a gotcha, though. There is no way to reset the &quot;cache&quot; from the outside. You have to write it into each and every memoizing function explicitly.

In your example, this could become important if, for instance, you suddenly want to use GetArticleById in a very long-running command-line script (e.g. a nightly cron job), where you might end up calling it thousands of times in the same run. Pretty soon, you would hit memory allocation limits, stale data and what have we.

In such cases, you will either have to maintain two versions of the function or extend it with some cache manipulation parameters.</description>
		<content:encoded><![CDATA[<p>Yeah, it is a very neat trick that is used in many projects, such as Drupal. A real lifesaver at times.</p>
<p>It has a gotcha, though. There is no way to reset the &#8220;cache&#8221; from the outside. You have to write it into each and every memoizing function explicitly.</p>
<p>In your example, this could become important if, for instance, you suddenly want to use GetArticleById in a very long-running command-line script (e.g. a nightly cron job), where you might end up calling it thousands of times in the same run. Pretty soon, you would hit memory allocation limits, stale data and what have we.</p>
<p>In such cases, you will either have to maintain two versions of the function or extend it with some cache manipulation parameters.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jean-Michel Feurprier</title>
		<link>http://www.jmfeurprier.com/blog/2009/02/04/improving-performance-with-return-values-caching/comment-page-1/#comment-3</link>
		<dc:creator>Jean-Michel Feurprier</dc:creator>
		<pubDate>Thu, 05 Feb 2009 15:14:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.jmfeurprier.com/blog/2009/02/04/improving-performance-with-return-values-caching/#comment-3</guid>
		<description>Thanks a lot for the information, I didn&#039;t know there was a name for it !</description>
		<content:encoded><![CDATA[<p>Thanks a lot for the information, I didn&#8217;t know there was a name for it !</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Marcos Silva Pereira</title>
		<link>http://www.jmfeurprier.com/blog/2009/02/04/improving-performance-with-return-values-caching/comment-page-1/#comment-2</link>
		<dc:creator>Marcos Silva Pereira</dc:creator>
		<pubDate>Thu, 05 Feb 2009 14:54:44 +0000</pubDate>
		<guid isPermaLink="false">http://www.jmfeurprier.com/blog/2009/02/04/improving-performance-with-return-values-caching/#comment-2</guid>
		<description>This technique has a name: Memoization: http://en.wikipedia.org/wiki/Memoization

I mainly have used it when programming in JavaScript, but, sure, the concept is useful when using another languages.

Kind Regards</description>
		<content:encoded><![CDATA[<p>This technique has a name: Memoization: <a href="http://en.wikipedia.org/wiki/Memoization" rel="nofollow">http://en.wikipedia.org/wiki/Memoization</a></p>
<p>I mainly have used it when programming in JavaScript, but, sure, the concept is useful when using another languages.</p>
<p>Kind Regards</p>
]]></content:encoded>
	</item>
</channel>
</rss>
