BOLT Merged Into LLVM To Optimize Binaries For Faster Performance
Merged into LLVM's mono repository minutes ago was BOLT! This is the Facebook-developed tool for optimizing the layout of binaries in the name of delivering greater performance. Facebook (now Meta) already has been using BOLT internally to great success with production workloads, it's continued advancing in the public as open-source for a while, and is now upstream in LLVM for fostering its future development.
We have been eagerly tracking Facebook's work on BOLT going back to 2018 with their focus on speeding up Linux binaries by optimizing the code layout for binaries generated by GCC and Clang for efficient CPU cache usage and other considerations. BOLT makes use of several LLVM libraries but has been developed out-of-tree over the past number of years.
Since 2020 they have been working to upstream BOLT into LLVM as a new sub-project. They have simultaneously continued advancing it even around areas like BOLT optimizing the Linux kernel to great success:
It depends upon many factors, but depending upon the workload the benefit in general of using BOLT can be anywhere from single to double digit percentage improvements. BOLT's advantages are even on top of the likes of compiler LTO (Link Time Optimizations) and PGO (Profile Guided Optimizations) tuning. Like PGO, BOLT does require proper profiling.
BOLT is very promising and now exciting that as of today lives in upstream LLVM.
See this Facebook research paper for more background information and technical details on its design. Facebook for their data center usage of BOLT reports, "For datacenter applications, BOLT achieves up to 7.0% performance speedups on top of profile-guided function reordering and LTO. For the GCC and Clang compilers, our evaluation shows that BOLT speeds up their binaries by up to 20.4% on top of FDO and LTO, and up to 52.1% if the binaries are built without FDO and LTO."
The merge of BOLT into LLVM's mono repository is 89.5k lines of new code.
We have been eagerly tracking Facebook's work on BOLT going back to 2018 with their focus on speeding up Linux binaries by optimizing the code layout for binaries generated by GCC and Clang for efficient CPU cache usage and other considerations. BOLT makes use of several LLVM libraries but has been developed out-of-tree over the past number of years.
Since 2020 they have been working to upstream BOLT into LLVM as a new sub-project. They have simultaneously continued advancing it even around areas like BOLT optimizing the Linux kernel to great success:
It depends upon many factors, but depending upon the workload the benefit in general of using BOLT can be anywhere from single to double digit percentage improvements. BOLT's advantages are even on top of the likes of compiler LTO (Link Time Optimizations) and PGO (Profile Guided Optimizations) tuning. Like PGO, BOLT does require proper profiling.
BOLT is very promising and now exciting that as of today lives in upstream LLVM.
See this Facebook research paper for more background information and technical details on its design. Facebook for their data center usage of BOLT reports, "For datacenter applications, BOLT achieves up to 7.0% performance speedups on top of profile-guided function reordering and LTO. For the GCC and Clang compilers, our evaluation shows that BOLT speeds up their binaries by up to 20.4% on top of FDO and LTO, and up to 52.1% if the binaries are built without FDO and LTO."
The merge of BOLT into LLVM's mono repository is 89.5k lines of new code.
25 Comments