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 HAA04558; Wed, 17 Oct 2001 07:32:30 +0200 (MET DST) 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 HAA04557 for caml-list@pauillac.inria.fr; Wed, 17 Oct 2001 07:32:29 +0200 (MET DST) 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 XAA01339 for ; Tue, 16 Oct 2001 23:43:51 +0200 (MET DST) Received: from ns.bagley.org (ns.bagley.org [216.30.46.2]) by concorde.inria.fr (8.11.1/8.10.0) with ESMTP id f9GLhoj28421 for ; Tue, 16 Oct 2001 23:43:50 +0200 (MET DST) Received: by ns.bagley.org (TRS/80 Mail Daemon, from userid 500) id D66C1FBDB9; Tue, 16 Oct 2001 16:43:50 -0500 (CDT) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <15308.43542.739467.829866@ns.bagley.org> Date: Tue, 16 Oct 2001 16:43:50 -0500 To: "Rolf Wester" Cc: caml-list@inria.fr Subject: Re: [Caml-list] OCaml speed From: Doug Bagley Organization: Junior Carrot Patrol! X-Face: "|NaWfYJ-]P="T#?R.9}QgGuFXUd@3vi[.E2q-;"NV3+k_y@zreL2w^ts0XPXtt9^9{uQ@.cu2GgUgK9@HXC\a}Rtah}0'eT~>or7[~Hd?;!\Bpo#"3w>0a0ft-MvvZ In-Reply-To: <3BCB2D45.29070.4316C73C@localhost> References: <3BCB2D45.29070.4316C73C@localhost> Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Rolf Wester wrote: > 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? I don't think you are necessarily doing anything "wrong", but you are testing in a manner quite differently from me. Some ideas: - Our architectures are quite different, I'm using an old PII-450Mhz. - I time the programs externally, you time them internally. - I compile the ocaml source with: > ocamlopt -noassert -unsafe -ccopt -O3 ary.ml -o ary.run You apparently compiled with: > ocamlopt -o aa_ml unix.cmxa aa.ml The last one is probably what makes the most difference. Cheers, Doug ------------------- 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