Arrays and arrays

Ketil Z. Malde ketil@ii.uib.no
21 Jan 2003 14:20:28 +0100


ketil@ii.uib.no (Ketil Z. Malde) writes:

>>   replace :: UArray Int Int -> [(Int,Int)] -> UArray Int Int
>>   replace a p = runST (thaw a >>= \u -> update u p >> freeze u)
>> 
>>   update :: STUArray s Int Int -> [(Int,Int)] -> ST s ()
>>   update u ps = mapM_ (uncurry (writeArray u)) ps

> (I'll be right back with the benchmarks.)

I know you're all eagerly waiting for this, so here's a small progress
report.  Or lack-of-progress report, if you like.

Apparently, I get really huge memory consumption when using the above
repeatedly.  Normally, I can deal with it, but profiling (-h) doesn't
show any likely culprit, the curves stay well below 60k for the most
part.  I know there are different kinds of memory profiles (retainer
profile, etc), is that where I have too look?  Or is the problem
something else?

-kzm
-- 
If I haven't seen further, it is by standing in the footprints of giants