Sample programs for comparison of different VM interpretation techniques. See the Makefile for the full list of targets.
switched
- switched interpreterthreaded
- threaded interpreterpredecoded
- switched interpreter with preliminary decoding phasesubroutined
- subroutined interpreterthreaded-cached
- threaded interpreter with pre-decoding.tailrecursive
- subroutined interpreter with tail-call optimizationtranslated
- binary translator to Intel 64 machine codenative
- a static implementation of the test program in CJust type make
. For Visual Studio builds, open corresponding project or solution files.
Use make sanity
to perform a quick check of all variants.
Use ./measure.sh
to measure run time of individual binaries or to perform a comparison of all techniques (alternatively, run make all measure
).
The graph plotting part of the script uses Gnuplot and AWK.
An article discussing structure, performance variations, and comparison of interpreters: http://habrahabr.ru/company/intel/blog/261665/ (in Russian).