[Haskell-cafe] speed: ghc vs gcc
leimy2k at gmail.com
Fri Feb 20 10:52:03 EST 2009
On Fri, Feb 20, 2009 at 6:39 AM, Dan Doel <dan.doel at gmail.com> wrote:
> 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
> 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
> Not that I'd be sad if GHC could reduce that whole constant at compile
> but GCC isn't doing 1 billion adds in 6 (or even 60) milliseconds.
The GCC optimizer must know that you can't return a value to user space of
that large as a return result.
In Haskell you're printing it... why not print it in C++?
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe