[Haskell-cafe] GHC needs a 64 bit machine to be fast?

Don Stewart dons at galois.com
Wed Apr 8 12:40:02 EDT 2009


GCC is generating very different code on 32 bit and 64 bit.

fft1976:
> Not that this is a very good benchmark, but I compiled the nearly
> equivalent C and Haskell (1st, recursive version) programs from this
> blog post:
> 
> http://donsbot.wordpress.com/2008/06/04/haskell-as-fast-as-c-working-at-a-high-altitude-for-low-level-performance/
> 
> There, in both versions, 1e9 iterations take 1.8s.
> 
> However, in my timing on 32-bit Linux machines, the C version is 5-10
> times faster. Does the bitness of the OS make a big difference?
> 
> Here are my timings on a 3.4GHz Pentium D:
> 
> C : 4.072s (GCC  4.2.4)
> Haskell : 22.481s (GHC 6.10.2 and 6.8.2 are about the same here)
> 
> I used the exact same compiler options as in the blog post. I only added
> 
> import System
> import Text.Printf
> 
> to the Haskell program, which seems to be missing.
> 
> Suspiciously, "ghc -O2  --make" is almost as fast at 24.438s (6.10.2)
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe


More information about the Haskell-Cafe mailing list