<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/1.5" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
	<title>Comments on: The Treacherous Optimization</title>
	<link>http://ridiculousfish.com/blog/archives/2006/05/30/old-age-and-treachery/</link>
	<description>serious code</description>
	<pubDate>Sat, 05 Jul 2008 18:16:17 +0000</pubDate>
	<generator>http://wordpress.org/?v=1.5</generator>

	<item>
		<title>by: Reinder</title>
		<link>http://ridiculousfish.com/blog/archives/2006/05/30/old-age-and-treachery/#comment-906</link>
		<pubDate>Tue, 30 May 2006 09:20:25 +0000</pubDate>
		<guid>http://ridiculousfish.com/blog/archives/2006/05/30/old-age-and-treachery/#comment-906</guid>
					<description>Some possible improvements spring to my mind:
- you should be able to offset tp by one, replacing &quot;tp[-1]&quot; by *tp (check first whether your compiler managed to do that, and whether this actually makes a difference on your CPU)
- vectorize the search by running searches starting at offsets 0, N, 2N, 3N for haystacks of size N + length( searchString) - 1 in parallel (N would have to be fairly large relative to the search string; measure first whether there is memory bandwidth available)

I also wonder whether the grep programmer used actual data to arrive at that 2,3,3,2 pattern.</description>
		<content:encoded><![CDATA[	<p>Some possible improvements spring to my mind:<br />
- you should be able to offset tp by one, replacing &#8220;tp[-1]&#8221; by *tp (check first whether your compiler managed to do that, and whether this actually makes a difference on your CPU)<br />
- vectorize the search by running searches starting at offsets 0, N, 2N, 3N for haystacks of size N + length( searchString) - 1 in parallel (N would have to be fairly large relative to the search string; measure first whether there is memory bandwidth available)</p>
	<p>I also wonder whether the grep programmer used actual data to arrive at that 2,3,3,2 pattern.
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Scott</title>
		<link>http://ridiculousfish.com/blog/archives/2006/05/30/old-age-and-treachery/#comment-911</link>
		<pubDate>Tue, 30 May 2006 10:47:22 +0000</pubDate>
		<guid>http://ridiculousfish.com/blog/archives/2006/05/30/old-age-and-treachery/#comment-911</guid>
					<description>I think you mean &quot;prostrate&quot; (with an &quot;r&quot;)</description>
		<content:encoded><![CDATA[	<p>I think you mean &#8220;prostrate&#8221; (with an &#8220;r&#8221;)
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Vid Boi</title>
		<link>http://ridiculousfish.com/blog/archives/2006/05/30/old-age-and-treachery/#comment-913</link>
		<pubDate>Tue, 30 May 2006 11:20:36 +0000</pubDate>
		<guid>http://ridiculousfish.com/blog/archives/2006/05/30/old-age-and-treachery/#comment-913</guid>
					<description>So the question is, how common are these partial matches in the real world (or for the average search in hex fiend)?  If rare then perhaps the performance gain by the &quot;treacherous grep&quot; technique is worth it.  If partial matches are common, then I would definitely favor the &quot;reformed grep.&quot;</description>
		<content:encoded><![CDATA[	<p>So the question is, how common are these partial matches in the real world (or for the average search in hex fiend)?  If rare then perhaps the performance gain by the &#8220;treacherous grep&#8221; technique is worth it.  If partial matches are common, then I would definitely favor the &#8220;reformed grep.&#8221;
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: ridiculous_fish</title>
		<link>http://ridiculousfish.com/blog/archives/2006/05/30/old-age-and-treachery/#comment-914</link>
		<pubDate>Tue, 30 May 2006 11:22:34 +0000</pubDate>
		<guid>http://ridiculousfish.com/blog/archives/2006/05/30/old-age-and-treachery/#comment-914</guid>
					<description>How embarassing - thank you, Scott.</description>
		<content:encoded><![CDATA[	<p>How embarassing - thank you, Scott.
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Samh</title>
		<link>http://ridiculousfish.com/blog/archives/2006/05/30/old-age-and-treachery/#comment-920</link>
		<pubDate>Tue, 30 May 2006 14:10:20 +0000</pubDate>
		<guid>http://ridiculousfish.com/blog/archives/2006/05/30/old-age-and-treachery/#comment-920</guid>
					<description>&quot;clean shaven beer&quot; ?

I like my beer fuzz-free</description>
		<content:encoded><![CDATA[	<p>&#8220;clean shaven beer&#8221; ?</p>
	<p>I like my beer fuzz-free
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Ian Holsman</title>
		<link>http://ridiculousfish.com/blog/archives/2006/05/30/old-age-and-treachery/#comment-925</link>
		<pubDate>Tue, 30 May 2006 17:23:21 +0000</pubDate>
		<guid>http://ridiculousfish.com/blog/archives/2006/05/30/old-age-and-treachery/#comment-925</guid>
					<description>how does fgrep compare? 
It uses a different algorithm doesn't it?</description>
		<content:encoded><![CDATA[	<p>how does fgrep compare?<br />
It uses a different algorithm doesn&#8217;t it?
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Steve Israelson</title>
		<link>http://ridiculousfish.com/blog/archives/2006/05/30/old-age-and-treachery/#comment-927</link>
		<pubDate>Tue, 30 May 2006 18:45:55 +0000</pubDate>
		<guid>http://ridiculousfish.com/blog/archives/2006/05/30/old-age-and-treachery/#comment-927</guid>
					<description>Can't you use something other than character comparisons? Seems to me comparing 8 bytes at a time would be faster if they were aligned. You could make 8 byte shifted versions so you can always compare byte aligned data. Then switch to your method for the remainder bytes at the non aligned start and end of the pattern.</description>
		<content:encoded><![CDATA[	<p>Can&#8217;t you use something other than character comparisons? Seems to me comparing 8 bytes at a time would be faster if they were aligned. You could make 8 byte shifted versions so you can always compare byte aligned data. Then switch to your method for the remainder bytes at the non aligned start and end of the pattern.
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Ridiculous Fish takes on grep</title>
		<link>http://ridiculousfish.com/blog/archives/2006/05/30/old-age-and-treachery/#comment-931</link>
		<pubDate>Tue, 30 May 2006 20:20:37 +0000</pubDate>
		<guid>http://ridiculousfish.com/blog/archives/2006/05/30/old-age-and-treachery/#comment-931</guid>
					<description>[...] 	Ridiculous Fish takes on grep 	 		Posted by Jon Baer 		Wed, 31 May 2006 03:20:18 GMT 	 	 	Ridiculous Fish takes on grep: &quot;I love Ridiculous Fish's blog. It makes [...]</description>
		<content:encoded><![CDATA[	<p>[...] 	Ridiculous Fish takes on grep 	 		Posted by Jon Baer 		Wed, 31 May 2006 03:20:18 GMT 	 	 	Ridiculous Fish takes on grep: &#8220;I love Ridiculous Fish&#8217;s blog. It makes [...]
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Mark</title>
		<link>http://ridiculousfish.com/blog/archives/2006/05/30/old-age-and-treachery/#comment-933</link>
		<pubDate>Tue, 30 May 2006 20:32:44 +0000</pubDate>
		<guid>http://ridiculousfish.com/blog/archives/2006/05/30/old-age-and-treachery/#comment-933</guid>
					<description>I did some snooping around with Google, and I think I've located a picture of your nemesis:

http://ducky.net/~kim/web_pictures/jacob_1year/UncleMike_paino_Jacob.jpg

(He's the taller one).
</description>
		<content:encoded><![CDATA[	<p>I did some snooping around with Google, and I think I&#8217;ve located a picture of your nemesis:</p>
	<p><a href='http://ducky.net/~kim/web_pictures/jacob_1year/UncleMike_paino_Jacob.jpg' rel='nofollow'>http://ducky.net/~kim/web_pictures/jacob_1year/UncleMike_paino_Jacob.jpg</a></p>
	<p>(He&#8217;s the taller one).
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: user</title>
		<link>http://ridiculousfish.com/blog/archives/2006/05/30/old-age-and-treachery/#comment-934</link>
		<pubDate>Tue, 30 May 2006 21:02:23 +0000</pubDate>
		<guid>http://ridiculousfish.com/blog/archives/2006/05/30/old-age-and-treachery/#comment-934</guid>
					<description>nice site design.  i like these little squares.  very nice.
i rarely comment.
</description>
		<content:encoded><![CDATA[	<p>nice site design.  i like these little squares.  very nice.<br />
i rarely comment.
</p>
]]></content:encoded>
				</item>
</channel>
</rss>
