|Indirect threading other than GCC? email@example.com (Heng Yuan) (2001-12-08)|
|Re: Indirect threading other than GCC? firstname.lastname@example.org (2001-12-09)|
|Re: Indirect threading other than GCC? email@example.com (Nicholas Geovanis) (2001-12-11)|
|Re: Indirect threading other than GCC? firstname.lastname@example.org (2001-12-15)|
|From:||email@example.com (Anton Ertl)|
|Date:||9 Dec 2001 21:55:46 -0500|
|Organization:||Institut fuer Computersprachen, Technische Universitaet Wien|
|Posted-Date:||09 Dec 2001 21:55:46 EST|
Heng Yuan <firstname.lastname@example.org> writes:
[indirect threaded code]
>Also, how much faster does it improve upon switch threading? Assume
>that the cases are all consecutive integers starting from 1. The
>number of cases can be from several to hundreds.
Results for a micro-benchmark are available at
<http://www.complang.tuwien.ac.at/forth/threading/>, but I would not
trust the results on CPUs with BTBs (the microbenchmark has
unrealistic prediction accuracy).
Results for real interpreters simulated on SimpleScalar with various
branch prediction schemes can be seen on
is no direct comparison of indirect threaded code to switch dispatch
there, but the slowdown of indirect threaded code over direct threaded
code is less than 20% for Gforth (depending on the machine); my guess
is that it would be in the same area for Ocaml and somewhat less for
Yap. Anyway, the results for SimpleScalar with a mispredict penalty
of 4 cycles, for currently available branch predictors, are that
switch dispatch costs 4.1-6.6 cycles more than direct threaded code,
resulting in a slowdown factor of up to 2.02.
Another comparison is available at
<http://www.complang.tuwien.ac.at/forth/performance.html>. Gforth uses
direct threaded threaded code (with indirect threaded code less than
10% slower on that machine), whereas thisForth uses switch dispatch
and is 3-4 times slower; however, thisForth contains other
inefficiencies besides switch dispatch, so this result is only useful
as an upper bound on the speed difference.
M. Anton Ertl
Return to the
Search the comp.compilers archives again.