<?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: Rails expire_fragment(regex) Considered Harmful</title>
	<atom:link href="http://gurge.com/blog/2007/02/04/rails-expire_fragmentregex-considered-harmful/feed/" rel="self" type="application/rss+xml" />
	<link>http://gurge.com/blog/2007/02/04/rails-expire_fragmentregex-considered-harmful/</link>
	<description></description>
	<lastBuildDate>Mon, 26 Nov 2007 10:17:44 -0600</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Scott Lamb</title>
		<link>http://gurge.com/blog/2007/02/04/rails-expire_fragmentregex-considered-harmful/comment-page-1/#comment-19948</link>
		<dc:creator>Scott Lamb</dc:creator>
		<pubDate>Sat, 17 Nov 2007 02:07:36 +0000</pubDate>
		<guid isPermaLink="false">http://gurge.com/blog/2007/02/04/rails-expire_fragmentregex-considered-harmful/#comment-19948</guid>
		<description>glob() is better than that but still not fast - it just gets all the directory entries and does an fnmatch() on each one.

On my ~1-year-old CentOS 5 Linux machine with warm cache, I just timed a non-matching glob() at 2 us per directory entry. Each unlink() also takes about 2 us. So that&#039;s an unnecessary 10 ms if you have 5,000 cache entries, or an unnecessary 200 ms if you have 100,000. Much better to just unlink() the entries that might be there than look at every entry first.</description>
		<content:encoded><![CDATA[<p>glob() is better than that but still not fast &#8211; it just gets all the directory entries and does an fnmatch() on each one.</p>
<p>On my ~1-year-old CentOS 5 Linux machine with warm cache, I just timed a non-matching glob() at 2 us per directory entry. Each unlink() also takes about 2 us. So that&#8217;s an unnecessary 10 ms if you have 5,000 cache entries, or an unnecessary 200 ms if you have 100,000. Much better to just unlink() the entries that might be there than look at every entry first.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ken</title>
		<link>http://gurge.com/blog/2007/02/04/rails-expire_fragmentregex-considered-harmful/comment-page-1/#comment-2336</link>
		<dc:creator>Ken</dc:creator>
		<pubDate>Mon, 05 Mar 2007 19:34:50 +0000</pubDate>
		<guid isPermaLink="false">http://gurge.com/blog/2007/02/04/rails-expire_fragmentregex-considered-harmful/#comment-2336</guid>
		<description>Ruby does have a glob method in the Dir class:

http://www.ruby-doc.org/core/classes/Dir.html#M002374

Couldn&#039;t you just use that to get the list of files (hopefully quickly) and then call expire_fragment on the results?</description>
		<content:encoded><![CDATA[<p>Ruby does have a glob method in the Dir class:</p>
<p><a href="http://www.ruby-doc.org/core/classes/Dir.html#M002374" rel="nofollow">http://www.ruby-doc.org/core/classes/Dir.html#M002374</a></p>
<p>Couldn&#8217;t you just use that to get the list of files (hopefully quickly) and then call expire_fragment on the results?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ken</title>
		<link>http://gurge.com/blog/2007/02/04/rails-expire_fragmentregex-considered-harmful/comment-page-1/#comment-2225</link>
		<dc:creator>Ken</dc:creator>
		<pubDate>Fri, 02 Mar 2007 20:39:47 +0000</pubDate>
		<guid isPermaLink="false">http://gurge.com/blog/2007/02/04/rails-expire_fragmentregex-considered-harmful/#comment-2225</guid>
		<description>Any way to force it to behave like glob instead of a stupid regex?  Unix solved making globbing fast about 30 years ago.</description>
		<content:encoded><![CDATA[<p>Any way to force it to behave like glob instead of a stupid regex?  Unix solved making globbing fast about 30 years ago.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
