3 ms·
I was talking about runtime executable optimization. In general, I don't think this is possible at link time. If the binary is linked in 2015, it's not possible
by vardump 11y ago
I was talking about runtime executable optimization. In general, I don't think this is possible at link time. If the binary is linked in 2015, it's not possible to know about CPUs available in 2035 or to utilize the new features, even if they're binary compatible.
Compiling (incl. linking) bakes in assumptions about target CPU. If these assumptions are incorrect, the performance will be sub-optimal. Even pathologic cases are possible, like order of magnitude lower performance in AMD Jaguar AVX stores.
CPUs have wildly different combinations of instruction set extensions. Instruction throughput and latency varies significantly. Cache subsystems are different.
So code that runs well on one CPU can run sub-optimally on another binary-compatible CPU.