The switch-vs-computed-goto dispatch comparison you're reasoning about here is the real optimization CPython 3.11's specializing adaptive interpreter made central to its 10-60% speedup, and warmup-then-measure is the same methodology behind the official pyperformance benchmark suite. Understanding where your VM's cycles go is the prerequisite for every performance task that follows.