[Haskell-cafe] speed: ghc vs gcc

Dan Doel dan.doel at gmail.com
Fri Feb 20 09:39:25 EST 2009

Sorry for replying to myself, but I got suspicious about the 6ms runtime of 
the 64-bit C++ code on my machine. So I looked at the assembly and found this:

            movabsq $499999999500000000, %rsi                                                                           
            movl    $_ZSt4cout, %edi                                                                                    
            pushq   %r12

I'm no assembly guru, but that makes me think that there's no actual 
computation going on in the runtime for the 64-bit C++ program, whereas the 
32-bit one is clearly doing work on my system, since it takes around 1 second.

Not that I'd be sad if GHC could reduce that whole constant at compile time, 
but GCC isn't doing 1 billion adds in 6 (or even 60) milliseconds.

More information about the Haskell-Cafe mailing list