[Haskell-beginners] Integer performance of GHC

Sebastián E. Peyrott pseus7 at gmail.com
Fri Aug 6 23:32:23 EDT 2010

Hi, I'm looking for information on Haskell's viability for heavy
integer math. My (very) naive tests show Haskell lagging behind C even
when doing heavy (manual) inlining, compiling with special
optimizations (funbox-strict-fields) and using
continuation-passing-style when possible. Of course, being a beginner
myself, I don't really know how good my code is.

For reference, I wrote a simple MD5 implementation. It's as fast as
the one in Happstack (Happstack.Crypto.MD5), which on my computer runs
around 2.77 times slower then the base version from GNU coreutils

GHC primitives appear as the next logical step in my tests, however
I've been having problems using fixed sizes for integers (Word32#
comes with no prim-ops defined?).

Do you have any insights on this? Is it reasonable to expect Haskell
integer performance to reach the levels of C with current
implementations? Which are the limiting factors?


More information about the Beginners mailing list