Re: [Haskell-cafe] Why does this program eat RAM?

2006-09-13 Thread Jan-Willem Maessen
On Sep 5, 2006, at 7:05 AM, Chris Kuklewicz wrote: Bulat Ziganshin wrote: Hello Bertram, Tuesday, September 5, 2006, 12:24:57 PM, you wrote: A quick hack up to use Data.ByteString uses a lot less ram, though profiling still shows 95% of time spent in the building the Map. Data.HashTable may

Re: [Haskell-cafe] Why does this program eat RAM?

2006-09-05 Thread Bertram Felgenhauer
Donald Bruce Stewart wrote: A quick hack up to use Data.ByteString uses a lot less ram, though profiling still shows 95% of time spent in the building the Map. Nice! k n w = Map.insertWith f w 1 n f _ x = let y = x + 1 in y `seq` y y `seq` y is semantically equivalent to

Re[2]: [Haskell-cafe] Why does this program eat RAM?

2006-09-05 Thread Bulat Ziganshin
Hello Bertram, Tuesday, September 5, 2006, 12:24:57 PM, you wrote: A quick hack up to use Data.ByteString uses a lot less ram, though profiling still shows 95% of time spent in the building the Map. Data.HashTable may be a faster alternative for Map (if ordering isn't required) -- Best

Re: [Haskell-cafe] Why does this program eat RAM?

2006-09-05 Thread Udo Stenzel
John Goerzen wrote: I have the below program, and I'm trying to run it on an input of about 90MB. It eats RAM like crazy, and I can't figure out why. wordfreq inp = Map.toList $ foldl' updatemap (Map.empty::Map.Map String Int) inp where updatemap nm word = Map.insertWith updatefunc

Re: [Haskell-cafe] Why does this program eat RAM?

2006-09-05 Thread Chris Kuklewicz
Bulat Ziganshin wrote: Hello Bertram, Tuesday, September 5, 2006, 12:24:57 PM, you wrote: A quick hack up to use Data.ByteString uses a lot less ram, though profiling still shows 95% of time spent in the building the Map. Data.HashTable may be a faster alternative for Map (if ordering isn't

Re: Re[2]: [Haskell-cafe] Why does this program eat RAM?

2006-09-05 Thread Udo Stenzel
Bulat Ziganshin wrote: Data.HashTable may be a faster alternative for Map (if ordering isn't required) Or it may not. Finding a good hash function for the words John is counting, is a challenge itself. Finding a good one that doesn't look at each character at least once, might be outright

Re: [Haskell-cafe] Why does this program eat RAM?

2006-09-05 Thread Ross Paterson
On Tue, Sep 05, 2006 at 12:55:48PM +0200, Udo Stenzel wrote: IMHO all accumulating functions, especially foldl, State.update, Map.insertWith, accumArray, absolutely need a strict version, because the strictness cannot be recovered by the library's user. We already have foldl'. Here's a strict

[Haskell-cafe] Why does this program eat RAM?

2006-09-04 Thread John Goerzen
I have the below program, and I'm trying to run it on an input of about 90MB. It eats RAM like crazy, and I can't figure out why. I do know that the problem is not my custwords function (as you can see, I replaced the call to it with a call to the standard words function on the last line). It

Re: [Haskell-cafe] Why does this program eat RAM?

2006-09-04 Thread Lennart Augustsson
The x+1 looks suspicious. On Sep 4, 2006, at 23:03 , John Goerzen wrote: I have the below program, and I'm trying to run it on an input of about 90MB. It eats RAM like crazy, and I can't figure out why. I do know that the problem is not my custwords function (as you can see, I replaced

Re: [Haskell-cafe] Why does this program eat RAM?

2006-09-04 Thread Jeremy Shaw
At Tue, 5 Sep 2006 03:03:51 + (UTC), John Goerzen wrote: I have the below program, and I'm trying to run it on an input of about 90MB. It eats RAM like crazy, and I can't figure out why. I have not looked in detail at your code -- but it could simply be the fact that String requires gobs

Re: [Haskell-cafe] Why does this program eat RAM?

2006-09-04 Thread Donald Bruce Stewart
jeremy.shaw: At Tue, 5 Sep 2006 03:03:51 + (UTC), John Goerzen wrote: I have the below program, and I'm trying to run it on an input of about 90MB. It eats RAM like crazy, and I can't figure out why. I have not looked in detail at your code -- but it could simply be the fact that

Re: [Haskell-cafe] Why does this program eat RAM?

2006-09-04 Thread Jeremy Shaw
At Mon, 04 Sep 2006 22:05:57 -0700, Jeremy Shaw wrote: At Tue, 5 Sep 2006 03:03:51 + (UTC), John Goerzen wrote: I have the below program, and I'm trying to run it on an input of about 90MB. It eats RAM like crazy, and I can't figure out why. If you fold a Data.Map or associative