[Haskell-cafe] C-like Haskell
duncan.coutts at worc.ox.ac.uk
Wed Jan 28 20:06:17 EST 2009
On Wed, 2009-01-28 at 16:42 -0800, drblanco wrote:
> I do already have the number I wanted, but was wondering how this could be
> made faster, or even why it's so slow. This is all on GHC 6.8.3 under OS X
> Intel, using ghc -O2.
I'm not exactly sure what's different, but for me it works pretty well.
I put back in the Int64 type signature.
> For comparison, the C code below runs in <1 second.
You've got a faster machine than me :-)
I compiled both the Haskell and C versions to standalone executables
with ghc/gcc -O2 and ran them with time.
$ time ./circ
Not too bad I'd say! :-)
I was using ghc-6.10 for this test. It would appear that ghc-6.8 is a
bit slower, I get:
Now the other difference is that I'm using a 64bit machine so perhaps
ghc just produces terrible code for Int64 on 32bit machines.
More information about the Haskell-Cafe