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 LAA05331; Tue, 11 Jun 2002 11:08:38 +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 LAA05426 for ; Tue, 11 Jun 2002 11:08:38 +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 g5B98aH28566; Tue, 11 Jun 2002 11:08:36 +0200 (MET DST) Received: (from xleroy@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id LAA05365; Tue, 11 Jun 2002 11:08:36 +0200 (MET DST) Date: Tue, 11 Jun 2002 11:08:36 +0200 From: Xavier Leroy To: Dmitry Bely Cc: caml-list@inria.fr Subject: Re: [Caml-list] Timing Ocaml Message-ID: <20020611110836.A3628@pauillac.inria.fr> References: <000001c2109e$d1052e10$5ccdfea9@fourquauu8eg3x> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0i In-Reply-To: ; from dbely@mail.ru on Tue, Jun 11, 2002 at 12:28:33PM +0400 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk > I see... But there is another solution: use C switch() operator in interp > main loop that is translated to jump table by MSVC optimizer (don't know if > gcc is capable to do this). Dmitry, don't be naive: of course the bytecode interpretor loop uses switch() if computed gotos are not available, and of course any C compiler translates this switch() to a jump table. But the jumptable is still significantly slower than the computed goto trick, since it involves one extra compare-and-branch and one extra memory load. This discussion ("efficient bytecode interpreters") is getting off-topic for caml-list, so please let's stop here. If you're still curious, the best way to understand the issues at hand is to stare at the assembly code generated for interp.c :-) - 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