3 ms·
> The main advantage of compilers is that the optimizations scale across a large codebase through inlining for example. This. You will die of natural causes w
by MaulingMonkey 10y ago
> The main advantage of compilers is that the optimizations scale across a large codebase through inlining for example.
This. You will die of natural causes well before beating the compiler en mass, on a number of codebases I've worked with. And even when dealing with the tight inner loop, I often optimize with a mind to, not so much beat the optimizer, but aid it.
There are plenty of obscenely low level optimizations - optimizations I'd argue are operating at an even lower level than assembly - that one can apply without actually resorting to assembly. Avoiding cache line aliasing, for example:
https://www.pvk.ca/Blog/2012/07/30/binary-search-is-a-pathological-case-for-caches/ https://www.pvk.ca/Blog/2012/07/30/binary-search-is-a-pathol...