[Haskell-cafe] Regression moving to ghc7

tsuraan tsuraan at gmail.com
Mon Jun 6 23:35:22 CEST 2011

I'm trying to write a rolling window variation of the adler32 hash
function (here: https://gist.github.com/1011151), and I got it to a
nearly acceptable speed under ghc 6.12.3 (~35MB/s on my work machine),
so I thought I'd see how the new ghc 7.0.3 treated it.  The answer is
"not good".  I get about 270KB/s.  The key difference that I'm seeing
from looking at the ghc-core program is that ghc 7.0.3 isn't using
primitive ops for anything (unless they are no longer annotated with

Can anybody shed any light as to what's going on?  I'd also welcome
any optimization tips that people would like to share.  I've been
messing with the code so much over the past day or two that I'm not
even sure if it computes an adler32 anymore, but I hope that any
optimization tops that pertain to that code would also apply to a
correct algorithm.  Right now, I'd just like to have the code run
quickly, and to figure out why I'm seeing such a terrible regression
under ghc7.

More information about the Haskell-Cafe mailing list