<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: Haskell as fast as C: working at a high altitude for low level performance</title>
	<atom:link href="http://donsbot.wordpress.com/2008/06/04/haskell-as-fast-as-c-working-at-a-high-altitude-for-low-level-performance/feed/" rel="self" type="application/rss+xml" />
	<link>http://donsbot.wordpress.com/2008/06/04/haskell-as-fast-as-c-working-at-a-high-altitude-for-low-level-performance/</link>
	<description>A Journal of Haskell Programming</description>
	<lastBuildDate>Mon, 03 Oct 2011 02:09:43 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: Migrating from uvector to vector &#171; Control.Monad.Writer</title>
		<link>http://donsbot.wordpress.com/2008/06/04/haskell-as-fast-as-c-working-at-a-high-altitude-for-low-level-performance/#comment-293</link>
		<dc:creator><![CDATA[Migrating from uvector to vector &#171; Control.Monad.Writer]]></dc:creator>
		<pubDate>Mon, 15 Feb 2010 21:31:57 +0000</pubDate>
		<guid isPermaLink="false">http://donsbot.wordpress.com/?p=103#comment-293</guid>
		<description><![CDATA[[...] These two libraries share a common origin, but have different engineering goals. Both libraries make heavy use of loop fusion based on streams to achieve excellent performance. (You can read more about that in a separate post). [...]]]></description>
		<content:encoded><![CDATA[<p>[...] These two libraries share a common origin, but have different engineering goals. Both libraries make heavy use of loop fusion based on streams to achieve excellent performance. (You can read more about that in a separate post). [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Self-optimizing data structures: using types to make lists faster &#171; Control.Monad.Writer</title>
		<link>http://donsbot.wordpress.com/2008/06/04/haskell-as-fast-as-c-working-at-a-high-altitude-for-low-level-performance/#comment-229</link>
		<dc:creator><![CDATA[Self-optimizing data structures: using types to make lists faster &#171; Control.Monad.Writer]]></dc:creator>
		<pubDate>Sun, 11 Oct 2009 22:34:05 +0000</pubDate>
		<guid isPermaLink="false">http://donsbot.wordpress.com/?p=103#comment-229</guid>
		<description><![CDATA[[...] is part of an ongoing series on high-performance Haskell programming. Related posts include stream fusion for lists, programming the inliner, Judy arrays and Haskell and applying stream fusion to [...]]]></description>
		<content:encoded><![CDATA[<p>[...] is part of an ongoing series on high-performance Haskell programming. Related posts include stream fusion for lists, programming the inliner, Judy arrays and Haskell and applying stream fusion to [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bill</title>
		<link>http://donsbot.wordpress.com/2008/06/04/haskell-as-fast-as-c-working-at-a-high-altitude-for-low-level-performance/#comment-185</link>
		<dc:creator><![CDATA[Bill]]></dc:creator>
		<pubDate>Mon, 07 Sep 2009 23:43:01 +0000</pubDate>
		<guid isPermaLink="false">http://donsbot.wordpress.com/?p=103#comment-185</guid>
		<description><![CDATA[Don,

Have you tried examples where the C compiler (eg. icc from Intel) manages to vectorize the code? Eg.

float f(float *fs, int n) {
  float r = 0.0f; 
  int i;
  for(i = 0; i &lt; n; i++) 
      r += (fs[i] * 3.14f) - (fs[i] + fs[1]);
  return r;
}


where we&#039;d expect the use of &#039;packed&#039; sse instructions? On recent machines this should be quite a bit faster.

Are there some from-the-trenches tricks we can use to get close to the same performance in Haskell using GHC?]]></description>
		<content:encoded><![CDATA[<p>Don,</p>
<p>Have you tried examples where the C compiler (eg. icc from Intel) manages to vectorize the code? Eg.</p>
<p>float f(float *fs, int n) {<br />
  float r = 0.0f;<br />
  int i;<br />
  for(i = 0; i &lt; n; i++)<br />
      r += (fs[i] * 3.14f) &#8211; (fs[i] + fs[1]);<br />
  return r;<br />
}</p>
<p>where we&#039;d expect the use of &#039;packed&#039; sse instructions? On recent machines this should be quite a bit faster.</p>
<p>Are there some from-the-trenches tricks we can use to get close to the same performance in Haskell using GHC?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Piotr Lesnicki</title>
		<link>http://donsbot.wordpress.com/2008/06/04/haskell-as-fast-as-c-working-at-a-high-altitude-for-low-level-performance/#comment-5</link>
		<dc:creator><![CDATA[Piotr Lesnicki]]></dc:creator>
		<pubDate>Thu, 22 Jan 2009 04:22:28 +0000</pubDate>
		<guid isPermaLink="false">http://donsbot.wordpress.com/?p=103#comment-5</guid>
		<description><![CDATA[Update on previous comment: I learned rewrite rules and adequate ghc options to fire them... So problem solved and you can delete previous comment.

We can make mean have type [Double]-&gt; Double and have list enumeration fused by writing:

{-# RULES
 &quot;toU/enumFromTo&quot;  forall (n::Double) (m::Double).
 toU (enumFromTo n m) = enumFromToFracU n m;
 #-}

mean :: [Double] -&gt; Double
mean xs = s / fromIntegral l
    where
      P s l = foldlU k (P 0 0) (toU xs)
      k (P s l) val = P (s+val) (l+1)

This is great!

However I have to admit that I find those ghc optimizations flags quite obscure (use of -funbox-strict-field for exemple). Details play a great role here!]]></description>
		<content:encoded><![CDATA[<p>Update on previous comment: I learned rewrite rules and adequate ghc options to fire them&#8230; So problem solved and you can delete previous comment.</p>
<p>We can make mean have type [Double]-&gt; Double and have list enumeration fused by writing:</p>
<p>{-# RULES<br />
 &#8220;toU/enumFromTo&#8221;  forall (n::Double) (m::Double).<br />
 toU (enumFromTo n m) = enumFromToFracU n m;<br />
 #-}</p>
<p>mean :: [Double] -&gt; Double<br />
mean xs = s / fromIntegral l<br />
    where<br />
      P s l = foldlU k (P 0 0) (toU xs)<br />
      k (P s l) val = P (s+val) (l+1)</p>
<p>This is great!</p>
<p>However I have to admit that I find those ghc optimizations flags quite obscure (use of -funbox-strict-field for exemple). Details play a great role here!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Piotr Lesnicki</title>
		<link>http://donsbot.wordpress.com/2008/06/04/haskell-as-fast-as-c-working-at-a-high-altitude-for-low-level-performance/#comment-4</link>
		<dc:creator><![CDATA[Piotr Lesnicki]]></dc:creator>
		<pubDate>Thu, 22 Jan 2009 02:53:39 +0000</pubDate>
		<guid isPermaLink="false">http://donsbot.wordpress.com/?p=103#comment-4</guid>
		<description><![CDATA[Suppose I would want mean to still have type ([Double] -&gt; Double) though. I see I can write it using (toU xs) inside of mean instead of (enumFromToFracU n m). Then fusion doesn&#039;t happen.

I&#039;m very novice with Haskell and so I quickly got stuck.

I suppose [1 .. d] is a syntactic sugar for (enumFromTo 1 d), so I made this rule in my file:

{-# RULES

 &quot;RealFrac.toU/enumFromTo&quot; (RealFrac n, RealFrac m) =&gt; forall n m.
 toU (enumFromTo n m) = enumFromToFracU n m
 #-}

It doesn&#039;t work unfortunatly. Could You have any guidance? Am I missing something or am I completly misleaded?]]></description>
		<content:encoded><![CDATA[<p>Suppose I would want mean to still have type ([Double] -&gt; Double) though. I see I can write it using (toU xs) inside of mean instead of (enumFromToFracU n m). Then fusion doesn&#8217;t happen.</p>
<p>I&#8217;m very novice with Haskell and so I quickly got stuck.</p>
<p>I suppose [1 .. d] is a syntactic sugar for (enumFromTo 1 d), so I made this rule in my file:</p>
<p>{-# RULES</p>
<p> &#8220;RealFrac.toU/enumFromTo&#8221; (RealFrac n, RealFrac m) =&gt; forall n m.<br />
 toU (enumFromTo n m) = enumFromToFracU n m<br />
 #-}</p>
<p>It doesn&#8217;t work unfortunatly. Could You have any guidance? Am I missing something or am I completly misleaded?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
