[Haskell] Performance, Optimization and Code Generation

Ian Lynagh igloo at earth.li
Tue Sep 26 14:51:01 EDT 2006


On Fri, Sep 22, 2006 at 08:30:20PM -0400, George Beshers wrote:
> 
> This starts out with my being interested in darcs <-> git related issues.
> Since git uses sha1 I wanted to have the ability to calculate sha1 in
> an application where I was intending to use darcs as a back-end.
> 
> The performance gap is > * 30 between Haskell and  sha1sum.  That
> seemed rather steep and so I started looking...

I did some work on optimising the SHA1.lhs in the darcs source a while
ago. My memory is that I got to about a factor of 2 of C, and that most
of the rest was due to GHC generating code with things like heap size
checks unnecessarily inside loops. It uses darcs' FPS rather than the
ByteString fork, of course, but it should be easy enough to port.

http://www.abridgegame.org/repos/darcs-unstable/SHA1.lhs


Thanks
Ian



More information about the Haskell mailing list