[Haskell-cafe] MD5? (was: Haskell performance question)

Stefan O'Rear stefanor at cox.net
Thu Nov 8 19:22:14 EST 2007


On Thu, Nov 08, 2007 at 06:14:20PM -0500, Thomas M. DuBuisson wrote:
> Glad you asked!
> 
> http://sequence.complete.org/node/367
> 
> I just posted that last night!  Once I get a a community.haskell.org
> login I will put the code on darcs.
> 
> The short of it it:
> 1) The code is still ugly, I haven't been modivated to clean.
> 2) Manually unrolled, it is ~ 6 times slower than C
> 3) When Rolled it is still much slower than that
> 4) There is some optimizer bug in GHC - this code could be 2x faster, I
> feel certain.
> 5) I benchmarked using a 200MB file, so I think it will handle whatever.

Why did you put yourself through all this pain when you could have just
copied the code from md5sum(1), removed the main function, and foreign
imported its buffer accumulator wrapping it as a function over lazy
bytestrings?  We have the best foreign function interface in the world.
Reinventing wheels is stupid, especially if the existing wheels are this
easy to use.

Stefan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://www.haskell.org/pipermail/haskell-cafe/attachments/20071108/eefb994c/attachment.bin


More information about the Haskell-Cafe mailing list