[Haskell-cafe] GHC strange behavior

Ruslan Evdokimov ruslan.evdokimov at gmail.com
Sat Feb 16 18:06:17 EST 2008

Hi, all!

I have strange GHC behavior. Consider the code:

import Control.Parallel

main = print (o `par` (fromInteger e) / (fromInteger o))
  [e,o] = map sum $ map (`filter` numbers) [even, odd]
  numbers = [1..10000000]

When it compiled without threaded it has 19068 ms to run, 396 Mb total
memory in use and %GC time      88.2%, the same with -threaded and +RTS -N1,
but with +RTS -N2 it takes only 3806 ms to run, 3 Mb total memory in use and
%GC time       8.1%. Why it so? It's a bug or I missed something?
I test it on dual-core Athlon X2 4200+ 2Gb running 64bit Gentoo system. gcc
4.2.2 and ghc 6.8.2.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20080217/a74764ab/attachment.htm

More information about the Haskell-Cafe mailing list