
25 Jan
2005
25 Jan
'05
10:59 p.m.
S. Alexander Jacobson writes:
After actually running the correct test, I am still getting semi-ridiculous space behavior (6k/pair)!
import qualified Map zipped =zip [1..] [1..100000]::[(Int,Int)] untup f (x,y) = f x y produce = foldr (untup Map.insert) Map.empty zipped fm = length $ Map.keys produce main = print $ fm
Two questions I'm currently too lazy to investigate myself:
Does having 'zipped' at the top level mean that the program is keeping
the entire 100,000-element list in memory?
Also, would performance improve if you used Map.fromList? How about
Map.fromAscList?
--
David Menendez