3 ms·
The article called it a threaded interpreter, the answer to this question explains what that usually means and why it it faster: https://stackoverflow.com/quest
by mattnewport 7y ago
The article called it a threaded interpreter, the answer to this question explains what that usually means and why it it faster: https://stackoverflow.com/questions/3848343/decode-and-dispatch-interpretation-vs-threaded-interpretation https://stackoverflow.com/questions/3848343/decode-and-dispa...
I found the explanation of what they're doing a little unclear though and it seems they might not be doing exactly what is described in the answer above.
- tom_mellior 7y agoThe dispatch part of the code snippet looks to me like what you would also get with computed gotos. Something like goto instruction_labels[++pc]. So that shouldn't be the difference, compilers can compile this well. As for whether this is "threaded", and exactly what kind of threading it is, there is widespread confusion and abuse of terminology. https://en.wikipedia.org/wiki/Threaded_code https://en.wikipedia.org/wiki/Threaded_code