From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id UAA27713; Tue, 30 Oct 2001 20:33:21 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id UAA27119 for caml-list@pauillac.inria.fr; Tue, 30 Oct 2001 20:33:20 +0100 (MET) Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id RAA23816 for ; Tue, 30 Oct 2001 17:24:43 +0100 (MET) Received: from julie.univ-savoie.fr (univax.univ-savoie.fr [193.48.120.32]) by concorde.inria.fr (8.11.1/8.10.0) with ESMTP id f9UGOhf20024 for ; Tue, 30 Oct 2001 17:24:43 +0100 (MET) Received: from post.bourget.univ-savoie.fr (post.bourget.univ-savoie.fr [193.48.120.73]) by julie.univ-savoie.fr (8.9.3/jtpda-5.3.3) with ESMTP id RAA94031 ; Tue, 30 Oct 2001 17:24:41 +0100 (CET) Received: from univ-savoie.fr (www.lama.univ-savoie.fr [193.48.123.134]) by post.bourget.univ-savoie.fr (8.12.0.Beta7/jtpda-5.3.3) with ESMTP id f9UGOWMP003730 ; Tue, 30 Oct 2001 17:24:36 +0100 Message-ID: <3BDED446.F44A1A7D@univ-savoie.fr> Date: Tue, 30 Oct 2001 17:24:38 +0100 From: Christophe Raffalli Organization: =?iso-8859-1?Q?Universit=E9?= de Savoie X-Mailer: Mozilla 4.77 [fr] (X11; U; Linux 2.2.16-9mdksmp i686) X-Accept-Language: en MIME-Version: 1.0 To: Rolf Wester CC: caml-list@inria.fr Subject: Re: [Caml-list] OCaml speed References: <3BCB2D45.29070.4316C73C@localhost> Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Rolf Wester a écrit : > > Hi, > > I used the array access example from http://www.bagley.org/~doug/shootout/ > to compare c/c++ speed against ocaml. The sources I used are attached below. > Unfortunately I could not confirm the given cpu times which are 0.11 sec for > gcc and 0.13 for ocamlopt. My results on a Compaq Alpha True64 are > 0.05 for cxx, 0.1 for g++ and 0.29 for ocamlopt. Does anybody have an idea > what could be the reason for this inconsistency? Did I do anything wrong? > Your code mainly does integer operations and array accesses. The main difference between C and Ocaml are the reserved bit in integer used by ocaml for the GC. Then the generated assembly code are really different and it is possible that this diffrence cost nothing (almost) on a pentium and a lot on a Alpha True64. May be Xavier Leroy could look at the assembly code to tell if I am right ? You could also try with float arrays which should make less difference for your code ? -- Christophe Raffalli Université de Savoie Batiment Le Chablais, bureau 21 73376 Le Bourget-du-Lac Cedex tél: (33) 4 79 75 81 03 fax: (33) 4 79 75 87 42 mail: Christophe.Raffalli@univ-savoie.fr www: http://www.lama.univ-savoie.fr/~RAFFALLI ------------------- Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr