[Haskell-cafe] Re: Round benchmarks

Daniel Fischer daniel.is.fischer at web.de
Mon Oct 11 05:19:58 EDT 2010


On Monday 11 October 2010 07:05:20 you wrote:
> Hi,
>
> These results seem different from the samples.

Thanks. The numbers are quite impressive.
Although the quotients (hence speedups) are generally much larger, the 
ranking doesn't differ much.

For round :: x -> Int, via C is a big win.
For round :: x -> Integer and properFraction :: Double -> (Integer, 
Double), going via C doesn't seem to make much difference on 64 bits, but 
they do on 32.
That's probably because a Double mantissa is a smallInteger on 64 bits.

Overall, your timings support going via C for round and
properFraction :: Double -> (Integer, Double).
In two cases, it makes not much difference on 64 bits but is a big gain on 
32, for round :: x -> Int, it's a big win on both.

>
> I was surprised that the "via Integer" results appear faster than the
> Int results.

No, the numbers are (Prelude time / new time), so the larger the number, 
the better.
Sorry for not making that clear in the README.

>
> Vivian

Cheers,
Daniel



More information about the Haskell-Cafe mailing list