[email protected]
[Top] [All Lists]

Re: [Haskell-cafe] Re: Difference in Runtime but no explanation

Subject: Re: [Haskell-cafe] Re: Difference in Runtime but no explanation
From: Thomas DuBuisson
Date: Tue, 15 Dec 2009 10:56:41 -0800
On Tue, Dec 15, 2009 at 10:30 AM, Maciej Piechotka
<[email protected]> wrote:
> My results (ghc 6.12.1, Core 2 Duo 2.8 GHz, Linux 2.6.32, Gentoo):
> Not Optimized & not compiled:
> First:  12.47 secs, 1530911440 bytes
> Second: 17.40 secs, 1929614816 bytes
> Optimized & compiled:
> First:   1.24 secs, 966280832 bytes
> Second:  1.11 secs, 966277152 bytes

Seconded, I consistently get 0.350 seconds vs 0.300 when compiling the
original code via -O2.

> Repeating gave similar results - first being better w/out
> optimalization as 1.2:1.7 and second being better with optimalizations (-O).
> Why the first one is better unoptimalized?

I think thats not a specific enough question.  I replaced the
'Integer' with 'Int' and found (via -ddump-asm) that the assembly is
_identical_. A test shows what you would expect - the performance was
identical.  So the question in my mind is what presumably trivial
optimization doesn't happen when Integer is used?

Haskell-Cafe mailing list
[email protected]

<Prev in Thread] Current Thread [Next in Thread>