From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id 43599BC8C for ; Sun, 16 Jan 2005 10:57:17 +0100 (CET) Received: from smtp.leledy.org (trudaine-3-82-67-204-75.fbx.proxad.net [82.67.204.75]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id j0G9vG8s015125 for ; Sun, 16 Jan 2005 10:57:17 +0100 Received: from [192.168.2.207] (dom7.leledy.org [192.168.2.207]) by smtp.leledy.org (Postfix) with ESMTP id EDE665ECF for ; Sun, 16 Jan 2005 10:59:18 +0100 (CET) Message-ID: <41EA3A86.2070408@leledy.org> Date: Sun, 16 Jan 2005 10:57:26 +0100 From: =?ISO-8859-1?Q?Philippe_Lel=E9dy?= User-Agent: Mozilla Thunderbird 1.0 (Macintosh/20041206) X-Accept-Language: fr, en MIME-Version: 1.0 To: Caml-list@yquem.inria.fr Subject: Re: [Caml-list] Ocaml sums the harmonic series -- four ways, four benchmarks: floating point performance Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Miltered: at concorde with ID 41EA3A7C.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 ocaml:01 wrote:01 ocamlopt:01 unboxed:01 powerpc:01 macos:01 91%:98 91%:98 caml:02 caml:02 debian:02 objective:02 objective:02 gnu:03 X-Spam-Checker-Version: SpamAssassin 3.0.0 (2004-09-13) on yquem.inria.fr X-Spam-Status: No, score=0.1 required=5.0 tests=FORGED_RCVD_HELO autolearn=disabled version=3.0.0 X-Spam-Level: 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.