
On 17 May 2004 14:53, Christian Maeder wrote:
Today there's additionally running a fat (600MB) vmware on davinci. I thought page faults somehow correlate with memory consumption. Have you a better idea to measure time and space?
Page faults, assuming you got the information from time(1) are pretty useless. For memory consumption you can measure two things: total allocation, which is gotten from '+RTS -sstderr -RTS', and live data, which is gotten from a heap profile. Beware laziness effects when making measurements: try to ensure that both examples are evaluating exactly the "same" things. By the way, can we see the code for your tests? What mix of operations are you measuring? What is the Map+IntMap version of your test measuring?
You can play the {-# UNPACK #-} trick in the IntMap code too, BTW. -- | A map of integers to values @a@.
data IntMap a = Nil | Tip !Key a | Bin !Prefix !Mask !(IntMap a) !(IntMap a)
On Prefix and Mask?
Yep.
When I omitted the "!" in " !k a !(Map k a) !(Map k a)"
time was faster but page faults increased:
Map-only: 7.37 29767
You should measure this version, because it is closer to what FiniteMap does (plus there seems to be no good reason to force strictness on the elements in a general purpose Map type). Cheers, Simon