*bump*
1. I found this paper today that discusses interpreters with branch target predictions of modern hardware:
https://hal.inria.fr/hal-01100647 (
PDF)
Conclusion: if you have at least a
Haswell CPU, the single point of dispatch (as with the top of
case-of) is no longer much of a problem.
2. Matt Godbolt
found that the number of entries in the Branch Target Buffer is 4096 - an impressive number, but keep in mind that every branch instruction, including
if-then, takes up one entry. So it'll be full if you have >= 16 branches in every handler of a
case-of with 256 cases; much less if you call many subroutines that use branches themselves or if the CPU core your thread runs on has to temporarily switch to another program.