by vilda · 9y ago · 0 comments
However, since the indirect jump instruction is shared
by all opcodes, the CPU will have a hard time making
the right prediction for where to jump next (actually,
it will be always wrong except in the uncommon case of
a sequence of several identical opcodes).
[1] https://github.com/python/cpython/blob/ff8ad0a576c6cf375e682...I actually have to thank the documentation there for explaining all the flags you need to turn on GCC to get the computed goto to work. By default gcc's optimizer will mess things up and I would have never figured out the flags by myself to be able to run my benchmarks