3 ms·
The problem of dispatch loops is not that they are "very branchy". The problem is the usual heuristic of less-code-is-better falls down. For an interpreter you
by qznc 13y ago
The problem of dispatch loops is not that they are "very branchy". The problem is the usual heuristic of less-code-is-better falls down. For an interpreter you want the dispatch code after every op handler again, so the branch predictor can do its work. Unfortunatelly, compilers are very good at removing this code duplication.