3 ms·
> Isn't that precisely the point of higher levels? I used to think that higher levels are for giving the compiler more time to think so it can come up with a b
by wongarsu 5y ago
> Isn't that precisely the point of higher levels?
I used to think that higher levels are for giving the compiler more time to think so it can come up with a better result (and for somewhat specifying the desired space-performance tradeoff). In my mind the "don't do it if you don't know what you are doing"-things were seperate flags, like -ffast-math.
Obviously I eventually learned that bad things can happen, but "just build prod with -O2" still seems to be what almost everyone does.
- astrange 5y ago-O3 mostly is “try harder” but in practice it is more about using more experimental/dangerous techniques than thinking harder. That’s because, basically, compiler optimizations aren’t as important as people think and there aren’t amazing insights you can come to by thinking harder. If there were, it’d be better for the compiler to tell the programmer about them rather than rediscover them every compilation.