Nessie wrote:If you're thinking of performance, I would guess that if the total size of two switches is smaller than one switch, they could possibly run faster. The few cycles wasted on table lookup are probably insignificant as long as your code fits in the cache.
The only reason for a smaller code switch running faster is whether it fits in the cache or not?
Is there another reason?
Apart from caching, which I'm not very aware of, I understand that if the switch gets translated into a jump table, it doesn't matter if the code is longer or shorter, the jumps speed shouldn't be affected, or am I wrong?
I prefer speed and source readability rather than smaller executable code, for my emulator.
And about the cache, I guess it's very platform-dependent, right?