3 ms·
>This is why you don't optimize first The internals of an optimizing compiler might very well be the worst place to apply that principle. Who else is supposed
by alex_smart 5y ago
>This is why you don't optimize first
The internals of an optimizing compiler might very well be the worst place to apply that principle. Who else is supposed to implement these optimizations, if not the compiler?
- setr 5y agoGP is talking to application developers, not compiler devs.
- alex_smart 5y agoI don't know how many application developers resort to manually generating the assembly, so not sure how that lesson can be gleaned out from the quoted passage.
- setr 5y agothe set of over-optimizing app developers will do just that :) But more generally, optimizations eventually stop being true in general, and start being true only in a specific context -- and the lower that optimization, the more specific that context gets. If you want to "teach" GCC how to optimize something properly (more commonly in the form of attribute notations e.g. inlining, but more extreme is poking around godbolt), you start falling into this trap