4 ms·
The new optimizations are about code layout and it seems are based on real-world perf data being fed back into the compilation process. So it wouldn't necessari
by mikepurvis 8y ago
The new optimizations are about code layout and it seems are based on real-world perf data being fed back into the compilation process. So it wouldn't necessarily be apparent to an initial compile what the hot code path is, but with that profiling information present you can arrange your binary in order to maximize hits on the code cache.
- hoosieree 8y agoThis sounds a lot like JIT compilation techniques, but applied to an already-compiled binary.
- tgtweak 8y agoI would think it's closer to branch prediction but on a larger scale than just instruction pipelines. I'm curious if it modifies the original binary.
- greglindahl 8y agoNote that "feedback optimization" using data from actual real-world perf data has been a standard part of compilers for decades. SPECcpu limits what you're allowed to do with it to avoid over-fitting.
- CoolGuySteve 8y agoGCC supports the hot and cold attributes so you can manually instruct the compiler how to arrange compilation sections. They basically set the PGO counts to +/- infinity for those functions. While nowhere near as nice as real profile guided optimization (and likely to grow stale over time), these attributes are much easier to insert compared to fighting with whatever build toolchain you’re using.
- RayDonnelly 8y agocold functions are also optimised at -Os.