I don't think the problem with performance of crypto has anything to do with unpacking ByteStrings. If I unpack the bytestrings first, then run the hash, and just time the hash algorithm, i still get 4 seconds with crypto where the C implementation gives me 0.02 seconds. Thats 200 times slower in haskell, to me it just seems like a bad implementation. You should be able to stay within an order of magnitude from C with haskell without resorting to weird compiler tricks. Anatoly On 6/20/07, Derek Elkins <derek.a.elkins@gmail.com> wrote:
On Wed, 2007-06-20 at 15:23 -0700, Jason Dagit wrote:
On 6/20/07, Andrew Coppin <andrewcoppin@btinternet.com> wrote:
Donald Bruce Stewart wrote:
Finally, to actually get C speed, use a C md5.
I always feel worried when people say this... It's almost like admitting "hey, Haskell is beautiful, but it can never be fast". I always find myself wanting that statement to be false...
I agree with you, but at the same time, if Don says something about the performance of Haskell I tend to trust him on it. I find that his ability to optimize Haskell tends to set the bar. Otoh, I'd love to see someone demonstrate otherwise here :)
Well this is something else Don said,
I'd suspect a pure haskell md5 over bytestrings would be competitive with a C implemetation though. Easier to just call OpenSSL.
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe