3 ms·
Would else if be actually faster on a modern CPU architecture?
by WithinReason 4y ago
Would else if be actually faster on a modern CPU architecture?
- pklausler 4y agoOnly measurement with real data would tell for sure, but I would bet "yes" if I had to. With the "else", the "if" predicate is being predicted over a smaller amount of relevant cases; without the "else", the prediction is going to have to cope with some amount of needless false results and is likely to be less accurate.