4 ms·
For most applications, the choice between an if-ladder and a switch statement should be driven mostly by legibility and not performance. If performance is at st
by silvio 17y ago
For most applications, the choice between an if-ladder and a switch statement should be driven mostly by legibility and not performance. If performance is at stake, I would look for I/O first, memory access patterns second, and instruction sequencing last.
- jacobolus 17y agoWhich is really the case for almost all such choices, and the reason that we generally favor languages with more expressive power and code clarity, rather than raw speed, except in tight inner loops.