-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: Enable ThinLTO #2548
chore: Enable ThinLTO #2548
Conversation
I would really love to see compilation time differences (or |
Another idea for the size reduction, that might not increase the build time a lot: cut off dependencies' debug symbols
since we don't use big executor runtimes, we won't loose important the backtrace info this way? |
Yup, I can provide those (though that'll take a while). Full LTO took about 20 minutes for me (vs 3 minutes for ThinLTO), which is far from ideal; however, we could add a custom |
Tbh I'm more interested in potential perf improvements, though size reduction is visible at glance |
AFAIK, we neither have any benchmark runs nor any historical perf data to notice any perf benefits LTO brings, hence I'm discussing the sizes only. |
You could just do an ad-hoc before-and-after comparison of some known expensive operation, like editing a multi-buffer with 1000 cursors, or something like that. |
A 20-minute LTO time, even if we only did it on CI for our releases, would definitely slow down our release process a bit. Do you have a sense of whether LTO time can be reduced by running on a machine with lots of CPU cores? We could upgrade the machine we use to build the releases. MacStadium (the service we use for cloud-hosted macs) offers a Mac Studio (which has 20 CPU cores instead of 8). |
I will upload timings that @SomeoneToIgnore requested tomorrow. In private convo we also came up with comparing sizes of various LTO flavours + |
Here are the timings.zip Commands: At the very least it may be worth a shot to try ThinLTO at some point in the future, as it aids cross-crate inlining and bunch of other optimisations. At the end of the day, features are more important right now so I guess we don't want to spend too much time on this? |
Nevermind, I guess "thin local LTO" is the default, which is different from "thin LTO". I'm open to just switching to "thin LTO" if the compile-time cost is low. |
Change Fat LTO to ThinLTO
I believe that most of Full LTO's size reduction comes from stripping unused code -> stripping debug info (as the difference is size is not nearly as big when Zed is built with Anyways, we can come back to this later. As it stands, I'll merge ThinLTO variant. Edit: we can also use multitargets to speed up bundle script. |
Per conversation with Antonio, I've suggested enabling full LTO; right now we use a crate-local ThinLTO, which does not inline function calls across crates.
main
size