
5 Sep
2006
5 Sep
'06
3:13 p.m.
On 2006-09-05, Udo Stenzel
The culprit is insertWith, it inserts unevaluated thunks into your map
This turned out to be the answer -- thanks! I posted a new version of the code here: http://changelog.complete.org/posts/536-Another-Haskell-Solution-to-Lars-Pro... This particular test set was a few hundred copies of the GPL. So the Map was fairly small, since each word occured many, many times -- but there weren't a whole lot of words. So the problem was not the inefficiency of Data.Map, nor the inefficiency of Strings (though that inefficiency does explain why the Python solution is faster, I'm sure). -- John