Re: [Haskell-cafe] g++ std:map vs GHC IntMap

2009-04-04 Thread Jon Harrop
On Thursday 26 March 2009 15:39:12 Manlio Perillo wrote: I also tried with Data.HashTable: http://hpaste.org/fastcgi/hpaste.fcgi/view?id=2902 but memory usage is 703 MB, and execution time is about 4.5 times slower! This is due to a perf bug in GHC's GC implementation that causes it to

Re: [Haskell-cafe] g++ std:map vs GHC IntMap

2009-04-04 Thread Peter Verswyvelen
On Sat, Apr 4, 2009 at 12:42 PM, Jon Harrop j...@ffconsultancy.com wrote: For comparison: Haskell hash table: 44s Haskell map: 7s F# hash table: 0.7s Ouch! That's pretty insane. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] g++ std:map vs GHC IntMap

2009-04-04 Thread Peter Verswyvelen
So how does F# IntMap version compares to Haskell's IntMap? On Sat, Apr 4, 2009 at 2:58 PM, Peter Verswyvelen bugf...@gmail.com wrote: On Sat, Apr 4, 2009 at 12:42 PM, Jon Harrop j...@ffconsultancy.com wrote: For comparison: Haskell hash table: 44s Haskell map: 7s F# hash table:

Re: [Haskell-cafe] g++ std:map vs GHC IntMap

2009-04-04 Thread Jon Harrop
On Saturday 04 April 2009 14:02:48 Peter Verswyvelen wrote: On Sat, Apr 4, 2009 at 12:42 PM, Jon Harrop j...@ffconsultancy.com wrote: For comparison: Haskell hash table: 44s Haskell map: 7s F# hash table: 0.7s So how does F# IntMap version compares to Haskell's IntMap?

[Haskell-cafe] g++ std:map vs GHC IntMap

2009-03-26 Thread Manlio Perillo
Hi. I have tried to compare performance of the g++ std::map versus the GHC IntMap. The test consists in adding 1000 elements to an empty map. Haskell code is here: http://hpaste.org/fastcgi/hpaste.fcgi/view?id=2899 C++ code is here: http://hpaste.org/fastcgi/hpaste.fcgi/view?id=2900

Re: [Haskell-cafe] g++ std:map vs GHC IntMap

2009-03-26 Thread Brandon S. Allbery KF8NH
On 2009 Mar 26, at 11:39, Manlio Perillo wrote: The execution time and CPU usage is almost the same. However the C++ version requires 305 MB, the GHC version 617 MB. I wonder how much of that is due to lifting (i.e. laziness). -- brandon s. allbery [solaris,freebsd,perl,pugs,haskell]

Re: [Haskell-cafe] g++ std:map vs GHC IntMap

2009-03-26 Thread Bulat Ziganshin
Hello Manlio, Thursday, March 26, 2009, 6:39:12 PM, you wrote: The test consists in adding 1000 elements to an empty map. +RTS -c -F1.1 then read about garbage collection -- Best regards, Bulatmailto:bulat.zigans...@gmail.com

Re: [Haskell-cafe] g++ std:map vs GHC IntMap

2009-03-26 Thread Manlio Perillo
Brandon S. Allbery KF8NH ha scritto: On 2009 Mar 26, at 11:39, Manlio Perillo wrote: The execution time and CPU usage is almost the same. However the C++ version requires 305 MB, the GHC version 617 MB. I wonder how much of that is due to lifting (i.e. laziness).

Re: [Haskell-cafe] g++ std:map vs GHC IntMap

2009-03-26 Thread Manlio Perillo
Bulat Ziganshin ha scritto: Hello Manlio, Thursday, March 26, 2009, 6:39:12 PM, you wrote: The test consists in adding 1000 elements to an empty map. +RTS -c -F1.1 then read about garbage collection It now requires 386 MB of memory, but is 4.7 times slower. So, now memory required

Re[2]: [Haskell-cafe] g++ std:map vs GHC IntMap

2009-03-26 Thread Bulat Ziganshin
Hello Manlio, Thursday, March 26, 2009, 8:17:03 PM, you wrote: So, now memory required is about the same as the C++ version, but how can I optimize memory usage without having to tweak the garbage collector? C++ doesn't use GC so why you compare? -- Best regards, Bulat

Re: [Haskell-cafe] g++ std:map vs GHC IntMap

2009-03-26 Thread Don Stewart
manlio_perillo: Bulat Ziganshin ha scritto: Hello Manlio, Thursday, March 26, 2009, 6:39:12 PM, you wrote: The test consists in adding 1000 elements to an empty map. +RTS -c -F1.1 then read about garbage collection It now requires 386 MB of memory, but is 4.7 times slower. So,

Re[2]: [Haskell-cafe] g++ std:map vs GHC IntMap

2009-03-26 Thread Bulat Ziganshin
Hello Don, Thursday, March 26, 2009, 8:26:18 PM, you wrote: +RTS -c -F1.1 It now requires 386 MB of memory, but is 4.7 times slower. So, now memory required is about the same as the C++ version, but how can I optimize memory usage without having to tweak the garbage collector? You'll