4 ms·
Yeah, sometimes the compiler unrolls too much and innocent looking one-liner can be compiled into a monstrosity like this: https://godbolt.org/z/aKtko5 https:/
by astn 8y ago
Yeah, sometimes the compiler unrolls too much and innocent looking one-liner can be compiled into a monstrosity like this:
https://godbolt.org/z/aKtko5 https://godbolt.org/z/aKtko5
- pertymcpert 8y agoIs that more performant?
- londons_explore 8y agoAre there no compilers which attempt to look at that code, decide 'that looks like 1<<(num-2) when n>=2', and replace the code entirely? There must be so many examples of bubble sort where quicksort would be better, and other code patterns which can be identified and replaced with something orders of magnitude faster.