3 ms·
That's only true if there are <= 3 "clusters" of switch case values, else compilers do smarter things. See https://youtu.be/gMqSinyL8uk https://youtu.be/gMqSiny
by bla3 7y ago
That's only true if there are <= 3 "clusters" of switch case values, else compilers do smarter things. See https://youtu.be/gMqSinyL8uk https://youtu.be/gMqSinyL8uk
- vortico 7y agoIs this what you mean by more clusters? Looks like clang compiles the two functions to roughly the same "tree search" code. https://godbolt.org/z/7M_3PU https://godbolt.org/z/7M_3PU