[Haskell-cafe] C-like Haskell

David White white at u.washington.edu
Wed Jan 28 21:00:18 EST 2009

Thanks for the help.  It's clear in retrospect that it was being too
lazy, but not why changing to Int64 did it.  The bang patterns made
the difference between runnable and not.

GHC 6.10 didn't make much of a difference, but there's no 64-bit build
for the Mac.  If this seems to come up again I'll have to set up
64-bit Linux in a virtual machine, which seems a bit convoluted.


On Wed, Jan 28, 2009 at 7:37 PM, Duncan Coutts
<duncan.coutts at worc.ox.ac.uk> wrote:
> On Wed, 2009-01-28 at 20:23 -0500, Ross Mellgren wrote:
>> Duncan, I think you must have some magics -- on my machine the
>> original code also takes forever.
>> Running with +RTS -S indicates it's allocating several gig of memory
>> or more.
> It runs in a tiny heap for me:
> ./circ2 +RTS -A10k -M20k -RTS
> 3141592653589764829
> +RTS -S indicates it allocated 8,512 bytes.
>> Applying some bang patterns gives me ~8s for 10^8 and somewhat more
>> than a minute for 10^9:
> I wonder if it is the 64 vs 32 bit machine difference. I recall some ghc
> ticket about Int64 having rather poor performance on 32bit x86 machines.
> I don't have a 32bit x86 machine to hand so I cannot easily test it.
> Duncan

More information about the Haskell-Cafe mailing list