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

Thomas M. DuBuisson thomas.dubuisson at gmail.com
Thu Nov 8 18:14:20 EST 2007


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.

Thomas DuBuisson

On Thu, 2007-11-08 at 22:14 +0000, Andrew Coppin wrote:
> Don Stewart wrote:
> > dpiponi:
> >   
> >> I was getting about 1.5s for the Haskell program and about 0.08s for
> >> the C one with the same n=10,000,000.
> >>     
> >
> > I'm sure we can do better than that!
> >   
> That's the spirit! :-D
> 
> 
> Speaking of which [yes, I'm going to totally hijack this thread now...], 
> does anybody have a Haskell MD5 hash implementation that goes fast? 
> IIRC, I found one in MissingH, and it worked great. Except that as soon 
> as you feed it a 10 MB file, the standard Unix "md5sum" executable takes 
> about 0.001s to do it, and the Haskell version goes crazy and starts 
> eating virtual memory like candy. o_O (Although given a few minutes it 
> *does* produce the correct answer. But given that I want to run it over 
> an entire CD......)
> 
> Given the choise, I'd *like* to find a fast 100% Haskell implementation 
> - but failing that, (nice) bindings to a fast C implementation will do I 
> guess. (I *only* need to compute MD5 hashes for files on disk. I don't 
> need to do anything more fancy than that...)
> 
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
-- 
"The philosophy behind your actions should never change, on the other
hand, the practicality of them is never constant." - Thomas Main
DuBuisson



More information about the Haskell-Cafe mailing list