Why are you interested in this? This is a very low-level micro-optimization, which is unlikely to give any noticeable performance improvement unless you have a very evil algorithm with the last nanoseconds that are already squeezed out of it.
If you have a specific case where you have verified that switch really an important bottleneck, don’t ask us (what do we know about your compiler, memory, processor, etc ..?), But measure yourself using tools, which you use in the environment that the code should execute. In each other case, just continue coding and try writing code so that it is readable, and not for premature optimization.
source share