Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] Timing Ocaml
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2002-06-11 (09:08)
From: Xavier Leroy <xavier.leroy@i...>
Subject: Re: [Caml-list] Timing Ocaml
> 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 Archives:
Bug reports: FAQ:
Beginner's list: