Array.ST is not being nice to me
simonmarhaskell at gmail.com
Fri Feb 8 07:05:53 EST 2008
Chris Kuklewicz wrote:
>> So my theory now is:
>> I do a large number of lookups.
> Try using Data.Array.Base.unsafeRead (and maybe
> ata.Array.Base.unsafeWrite). These avoid the bounds checking on the
> index each time you lookup something in the array.
Right. Also keep an eye on the GC time (+RTS -sstderr) if you're using
boxed mutable arrays - we don't do card-marking, so GC is pretty
sub-optimal when it comes to large mutable boxed arrays. Decreasing the
number of GCs with +RTS -A<big> can help if you're suffereing from this -
but always try with and without, sometimes it makes things worse by making
less effective use of the L2 cache.
More information about the Glasgow-haskell-users