[Haskell-cafe] haskell crypto is reaaaaaaaaaally slow

Bulat Ziganshin bulat.ziganshin at gmail.com
Thu Jun 21 00:10:18 EDT 2007


Hello David,

Thursday, June 21, 2007, 3:49:55 AM, you wrote:

>> A list of Word8 is -extremely- inefficient.

> To expand on that terse (but very true) statement, a list of Word8
> increases the space usage by a factor of probably around an order of
> magnitude (two pointers + 1 byte vs 1 byte), completely destroys your
> memory access pattern (which becomes random-access rather than sequential),
> and introduces additional nonlocal memory accesses.  One would hope that a
> hash function would be moderately close to being memory-limited, so we're
> talking about a multiple-order-of-magnitude slowdown.

if this list is produced lazily, then it will live in generation-2
area of GC which is 256kb large. lists are slow due to double laziness


-- 
Best regards,
 Bulat                            mailto:Bulat.Ziganshin at gmail.com



More information about the Haskell-Cafe mailing list