GHC needs a 64 bit machine to be fast?

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-hi... 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)

Hello, perhaps you are hit by following issue? http://hackage.haskell.org/trac/ghc/ticket/594 Cheers, Karel FFT wrote:
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-hi...
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@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

On Wed, Apr 8, 2009 at 1:14 AM, Karel Gardas
Hello,
perhaps you are hit by following issue? http://hackage.haskell.org/trac/ghc/ticket/594
The benchmark isn't using the native code generator, it compiles via C, as I understand. What are other people's timings on 32 bit Linux machines?

Regarding that, is it possible to generate 64-bit code using GHC on Windows?
On Wed, Apr 8, 2009 at 10:17 AM, FFT
On Wed, Apr 8, 2009 at 1:14 AM, Karel Gardas
wrote: Hello,
perhaps you are hit by following issue? http://hackage.haskell.org/trac/ghc/ticket/594
The benchmark isn't using the native code generator, it compiles via C, as I understand.
What are other people's timings on 32 bit Linux machines? _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Hello Peter, Wednesday, April 8, 2009, 12:58:25 PM, you wrote: No. it seems that i'm only user asking GHC team for 64-bit version
Regarding that, is it possible to generate 64-bit code using GHC on Windows?
On Wed, Apr 8, 2009 at 10:17 AM, FFT
wrote: On Wed, Apr 8, 2009 at 1:14 AM, Karel Gardas
wrote: Hello,
perhaps you are hit by following issue? http://hackage.haskell.org/trac/ghc/ticket/594
The benchmark isn't using the native code generator, it compiles via C, as I understand.
What are other people's timings on 32 bit Linux machines?
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
-- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com

Well, make that 2! :-)
On Wed, Apr 8, 2009 at 11:47 AM, Bulat Ziganshin
Hello Peter,
Wednesday, April 8, 2009, 12:58:25 PM, you wrote:
No. it seems that i'm only user asking GHC team for 64-bit version
Regarding that, is it possible to generate 64-bit code using GHC on Windows?
On Wed, Apr 8, 2009 at 10:17 AM, FFT
wrote: On Wed, Apr 8, 2009 at 1:14 AM, Karel Gardas
wrote: Hello,
perhaps you are hit by following issue? http://hackage.haskell.org/trac/ghc/ticket/594
The benchmark isn't using the native code generator, it compiles via C, as I understand.
What are other people's timings on 32 bit Linux machines?
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
-- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com

Hello Peter, Wednesday, April 8, 2009, 2:42:24 PM, you wrote: if you need win64 ghc version - add yourself to CC list of http://hackage.haskell.org/trac/ghc/ticket/1884
Well, make that 2! :-) On Wed, Apr 8, 2009 at 11:47 AM, Bulat Ziganshin
wrote: Hello Peter, Wednesday, April 8, 2009, 12:58:25 PM, you wrote:
No. it seems that i'm only user asking GHC team for 64-bit version
Regarding that, is it possible to generate 64-bit code using GHC on Windows?
On Wed, Apr 8, 2009 at 10:17 AM, FFT
wrote: On Wed, Apr 8, 2009 at 1:14 AM, Karel Gardas
wrote: >>> >>> Hello, >>> >>> perhaps you are hit by following issue? >>> http://hackage.haskell.org/trac/ghc/ticket/594 The benchmark isn't using the native code generator, it compiles via C, as I understand.
What are other people's timings on 32 bit Linux machines?
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
-- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com
-- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com

I will add myself a million times then :-)
On Tue, Apr 14, 2009 at 5:25 PM, Bulat Ziganshin
Hello Peter,
Wednesday, April 8, 2009, 2:42:24 PM, you wrote:
if you need win64 ghc version - add yourself to CC list of http://hackage.haskell.org/trac/ghc/ticket/1884
Well, make that 2! :-) On Wed, Apr 8, 2009 at 11:47 AM, Bulat Ziganshin
wrote: Hello Peter, Wednesday, April 8, 2009, 12:58:25 PM, you wrote:
No. it seems that i'm only user asking GHC team for 64-bit version
Regarding that, is it possible to generate 64-bit code using GHC on Windows?
On Wed, Apr 8, 2009 at 10:17 AM, FFT
wrote: On Wed, Apr 8, 2009 at 1:14 AM, Karel Gardas
wrote: Hello,
perhaps you are hit by following issue? http://hackage.haskell.org/trac/ghc/ticket/594
The benchmark isn't using the native code generator, it compiles via C, as I understand.
What are other people's timings on 32 bit Linux machines?
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
-- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com
-- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com

Update: I missed an earlier blog post and the discussion that followed it. http://donsbot.wordpress.com/2008/05/06/write-haskell-as-fast-as-c-exploitin... On 32-bit machines, -fexcess-presision makes GHC output faster (only 2 times slower than C instead of 5-10, in my tests)

Suspiciously, "ghc -O2 --make" is almost as fast at 24.438s (6.10.2)
You have to be careful when recompiling with a different -O setting that you first remove all intermediate files (.o and .hi). I think that GHC only looks at the source to determine which files need to be compiled and not at any settings.

pass the flag -fforce-recomp
On Wed, Apr 8, 2009 at 12:21 PM, Roel van Dijk
Suspiciously, "ghc -O2 --make" is almost as fast at 24.438s (6.10.2)
You have to be careful when recompiling with a different -O setting that you first remove all intermediate files (.o and .hi). I think that GHC only looks at the source to determine which files need to be compiled and not at any settings. _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

On Wed, Apr 8, 2009 at 3:21 AM, Roel van Dijk
Suspiciously, "ghc -O2 --make" is almost as fast at 24.438s (6.10.2)
You have to be careful when recompiling with a different -O setting that you first remove all intermediate files (.o and .hi). I think that GHC only looks at the source to determine which files need to be compiled and not at any settings.
Thanks, I noticed that. All these timings were done after the removal of intermediate files and recompilation.

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-hi...
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@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
participants (6)
-
Bulat Ziganshin
-
Don Stewart
-
FFT
-
Karel Gardas
-
Peter Verswyvelen
-
Roel van Dijk