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 RAA19620; Mon, 10 Jun 2002 17:01:47 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f 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 RAA19905 for ; Mon, 10 Jun 2002 17:01:46 +0200 (MET DST) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id g5AF1cb23516; Mon, 10 Jun 2002 17:01:38 +0200 (MET DST) Received: (from xleroy@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id RAA19815; Mon, 10 Jun 2002 17:01:38 +0200 (MET DST) Date: Mon, 10 Jun 2002 17:01:38 +0200 From: Xavier Leroy To: Blair Zajac Cc: Caml Mailing List Subject: Re: [Caml-list] Timing Ocaml Message-ID: <20020610170138.B19329@pauillac.inria.fr> References: <3D043AB6.510307D0@orcaware.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0i In-Reply-To: <3D043AB6.510307D0@orcaware.com>; from blair@orcaware.com on Sun, Jun 09, 2002 at 10:35:50PM -0700 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk > Reading that the bytecode interpreter for Ocaml runs 2/3 as fast > when compiled with VC 6 compared to gcc, has anybody done any > timing comparisons with VisualStudio.Net, Intel C++ 5.x or > Intel C++ 6.0? As others mentioned, the reason why gcc does a better job on the Caml bytecode interpreter is not that gcc generates better code all by itself (it doesn't), but that it supports "computed gotos" as a C language extension. The bytecode interpreter takes advantage of this feature by replacing opcodes with the addresses of the code fragments that execute them, saving a significant amount of time in the bytecode interpretation loop. Microsoft's C compilers don't support this extension, and I doubt Intel's compilers do, at least under Windows. (Although I seem to remember that Intel's compiler for Linux implements gcc extensions.) Someone else mentioned the explicit register declarations in the bytecode interpreter. This is another gcc-specific extension, but actually the bytecode interpreter uses them to work around the poor register allocation performed by gcc (it fails to guess correctly which local variables of the bytecode interpreter are most critical and should end up in registers). So, it's really a gcc feature used to work around a gcc deficiency :-) Other C compilers might actually get the registers right by themselves. - Xavier Leroy ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners