3 ms·
I wrote more or less the same interpreter in C using computed goto and in C++ without if anyone's interested. The C-version is several times faster, and I'm pre
by codr7 6y ago
I wrote more or less the same interpreter in C using computed goto and in C++ without if anyone's interested. The C-version is several times faster, and I'm pretty sure the dispatch method plays a part.
The reason I went with functions instead in C++ is to allow plugging new opcodes into the instruction set without updating the dispatch loop.
https://github.com/codr7/liblg https://github.com/codr7/liblg
https://github.com/codr7/liblgpp https://github.com/codr7/liblgpp