Re:Branch Prediction and the Performance of Interpreters – D...
by loup-vaillant on Monday August 10, 2015 @11:50AM
(#10035395)
> passing the next pointer from one opcode to the next (e.g. perl5)
> using an opcode array (lua)
Would you perchance have a couple links explaining what those are? A quick search on my end didn't turn up anything useful.
Re:Branch Prediction and the Performance of Interpreters – D...
by sanderjd on Monday August 10, 2015 @01:19PM
(#10035937)
Since you seem to know a lot about this, which popular interpreters would you say are "state of the art" and which are "conventional slow"? It seems that lua and luajit (and perhaps perl5?) are in the former category. Is everything else in the latter?
First, the fastest interpreter is never switch or "jump threading" (i.e. computed goto) based. It is either based on passing the next pointer from one opcode to the next (e.g. perl5) or using an opcode array (lua). Those two cache much better and don't need the dispatch overhead with a jump table at all. Not talking about asm tuned interpreter dispatch yet, which count as best of the best.
Second, the famous cited Ertl paper mostly suggested to use smaller opcodes to influence the icache. Lua and luajit do this with one-word ops and blow all other interpreters away.
Using the computed goto extension only helps in bypassing the out of bounds check at the start of the switch dispatch, and gains the famous 2-3%, and less on more modern CPU's. When talking about the differences, the differences should be explained.
Summary: This research result is not useful for state of the art interpreters, only for conventional slow interpreters. And for those the result should be ignored at all, as much better interpreter speedup techniques exist, not noted in this paper.