5 ms·
> We have also applied BOLT to GCC and Clang binaries, and our evaluation shows that BOLT speeds up these binaries by up to 15.3% How is this even possible? Do
by dev_dull 8y ago
> We have also applied BOLT to GCC and Clang binaries, and our evaluation shows that BOLT speeds up these binaries by up to 15.3%
How is this even possible? Doesn’t this mean that there’s probably just some inefficient or unoptimized compiler settings?
- mikepurvis 8y agoThe 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.
- ebikelaw 8y agoIf the program takes any time at all then the compiler was not optimal :-) But really, people don’t appreciate that icache and iTLB misses are absolutely crucial to real-world performance. The cache is everything. Code layout makes a massive difference (regarding other comments I’ve made here lately, this is another reason to hate shared libraries).
- CyberDildonics 8y agoWouldn't shared libraries actually group together instructions that are used at similar times?
- fnord123 8y agoEach of the passes has a nice comment explaining what it does: https://github.com/facebookincubator/BOLT/tree/master/src/Passes https://github.com/facebookincubator/BOLT/tree/master/src/Pa... e.g. https://github.com/facebookincubator/BOLT/blob/master/src/Passes/FrameOptimizer.h https://github.com/facebookincubator/BOLT/blob/master/src/Pa...