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 SAA22651; Mon, 10 Jun 2002 18:35:39 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id SAA22648 for ; Mon, 10 Jun 2002 18:35:38 +0200 (MET DST) Received: from relay.rinet.ru (relay.rinet.ru [195.54.192.35]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id g5AGZb908442 for ; Mon, 10 Jun 2002 18:35:37 +0200 (MET DST) Received: (from uucp@localhost) by relay.rinet.ru (8.11.6/8.11.6) with UUCP id g5AGZSM09841 for caml-list@inria.fr; Mon, 10 Jun 2002 20:35:28 +0400 (MSD) X-Envelope-To: caml-list@inria.fr Received: from bely.stormoff (BELY) [192.168.0.10] by stormoff with esmtp (Exim 3.12 #1 (Debian)) id 17HS3K-0006er-00; Mon, 10 Jun 2002 20:29:58 +0400 X-Comment-To: Xavier Leroy To: caml-list@inria.fr Subject: Re: [Caml-list] Timing Ocaml References: <3D043AB6.510307D0@orcaware.com> <20020610170138.B19329@pauillac.inria.fr> From: Dmitry Bely Date: Mon, 10 Jun 2002 20:29:59 +0400 In-Reply-To: <20020610170138.B19329@pauillac.inria.fr> (Xavier Leroy's message of "Mon, 10 Jun 2002 17:01:38 +0200") Message-ID: User-Agent: Gnus/5.090007 (Oort Gnus v0.07) XEmacs/21.4 (Economic Science (Windows [1]), i586-pc-win32) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Xavier Leroy writes: >> 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.) Thank a lot for the explanation. But why then not to use inline asm for MSVC, something like that: #if defined(__GNUC__) && __GNUC__ >= 2 #define indirect_goto(addr) goto (addr) #elif defined(_MSC_VER) #define indirect_goto(addr) \ { void* a = addr; __asm jmp dword ptr a; } #endif Hope to hear from you soon, Dmitry ------------------- 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