[Haskell-cafe] GHC vs GCC vs JHC

Roman Leshchinskiy rl at cse.unsw.edu.au
Sat Mar 27 20:24:21 EDT 2010

On 27/03/2010, at 05:27, John Meacham wrote:

> Here are jhc's timings for the same programs on my machine. gcc and ghc
> both used -O3 and jhc had its full standard optimizations turned on.
> jhc:
> ./hs.out  5.12s user 0.07s system 96% cpu 5.380 total
> gcc:
> ./a.out  5.58s user 0.00s system 97% cpu 5.710 total
> ghc:
> ./try  31.11s user 0.00s system 96% cpu 32.200 total

I really don't understand these GHC numbers. I get about 3s for the C version, about 5s for GHC with rem and about 7.5s for GHC with mod. Is this perhaps on a 64-bit system? What is sizeof(int) in C and sizeOf (undefined :: Int) in Haskell?

That said, I suspect the only thing this benchmark really measures is how fast the various compilers can compute i * i + j * j + k * k `mod` 7.


More information about the Haskell-Cafe mailing list