
On 14 May 2004 19:14, Christian Maeder wrote:
for a map with several hundred thousand entries: (user seconds) (page faults) FiniteMap-only: 5.61 30613 DData.Map-only: 6.50 36911 DData.Map+IntMap: 4.14 21296 FiniteMap+IntMap: 3.85 19973
for optimized code only (I'll send you the sources separately)
Could you try changing the definition of Map from data Map k a = Tip | Bin !Size !k a !(Map k a) !(Map k a) to data Map k a = Tip | Bin {-# UNPACK #-} !Size !k a !(Map k a) !(Map k a) and see if that helps? Cheers, Simon

On Mon, 17 May 2004 13:39:38 +0100, Simon Marlow
On 14 May 2004 19:14, Christian Maeder wrote:
for a map with several hundred thousand entries: (user seconds) (page faults) FiniteMap-only: 5.61 30613 DData.Map-only: 6.50 36911 DData.Map+IntMap: 4.14 21296 FiniteMap+IntMap: 3.85 19973
for optimized code only (I'll send you the sources separately)
Could you try changing the definition of Map from
data Map k a = Tip | Bin !Size !k a !(Map k a) !(Map k a)
to
data Map k a = Tip | Bin {-# UNPACK #-} !Size !k a !(Map k a) !(Map k a)
and see if that helps?
I just wondered: is Data.FiniteMap strict in its elements? -- Daan. ps. Simon: The cvs source browse link on the GHC page seems broken, so I couldn't look it up myself...

Simon Marlow wrote:
On 14 May 2004 19:14, Christian Maeder wrote:
for a map with several hundred thousand entries: (user seconds) (page faults) FiniteMap-only: 5.61 30613 DData.Map-only: 6.50 36911 DData.Map+IntMap: 4.14 21296 FiniteMap+IntMap: 3.85 19973
Could you try changing the definition of Map from to
data Map k a = Tip | Bin {-# UNPACK #-} !Size !k a !(Map k a) !(Map k a)
and see if that helps?
Yes, that helps. For some reason the user time decreased today, but the page faults for the unchanged code kept the same: FiniteMap-only: 7.94 30613 DData.Map-only: 7.88 29700 DData.Map+IntMap: 5.72 20178 FiniteMap+IntMap: 5.54 19973 Christian
participants (3)
-
Christian Maeder
-
Daan Leijen
-
Simon Marlow