Version française
Home     About     Download     Resources     Contact us    
Browse thread
Re: [Caml-list] Ocaml sums the harmonic series -- four ways, four benchmarks: floating point performance
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Philippe_Lelédy <phl@l...>
Subject: Re: [Caml-list] Ocaml sums the harmonic series -- four ways, four benchmarks: floating point performance
Xavier Leroy wrote:

>   done;
>    !sum +. 0.0;;
>
> The + 0.0 at the end is ugly but convinces ocamlopt that !sum is best
> kept unboxed during the loop.

Here are my times which show little difference w/ or w/o this hack

On 1.8 GHz PowerPC G5 (MacOS X 10.3.7, Objective Caml version 3.08.0)

./sumH4 1000000000  17.65s user 0.16s system 91% cpu 19.461 total
./sumH5 1000000000  16.17s user 0.11s system 91% cpu 17.702 total

On Intel(R) Pentium(R) 4 CPU 3.00GHz (Debian GNU/Linux, Objective Caml version 3.08.2)

./sumH4 1000000000  15,57s user 0,00s system 99% cpu 15,646 total
./sumH5 1000000000  15,45s user 0,00s system 99% cpu 15,480 total

Ph. L.