-
-
Notifications
You must be signed in to change notification settings - Fork 720
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
Enable LTO in supported compilers #5874
base: main
Are you sure you want to change the base?
Conversation
Benefits of LTO
Downsides of LTO
|
Some stats on my machine (test before the patch) GCC (-flto=auto): Clang(-flto=thin)
|
Obviously this support is still experimental, but nice addition to have. Thoughts? @vaxerski |
looking at the drawbacks, I'm not convinced this is a good idea. |
I do agree that this should not be enabled by default :) |
Well I'm not sure, where it's mentioned that LTO is experimental. Both GCC and Clang claim it's mature. Maybe it was experimental a few years ago, but it's not currently. Chromium, Firefox and many more much complex and bigger projects use it. @vaxerski Is there a good CPU bottleneck benchmark I can use to compare LTO and non-LTO builds? |
no clue, I've never used lto |
@In-line can you provide a "patch" for meson based building too? I'll try to build and test it on Nix. |
@JohnRTitor you can rebase this PR on top of #5667 to test. I'm going to merge that soon. |
I am not the PR author this time :) |
I still think this should be left as an "option", the compile times will vary due to hardware and feature sets. Compilation time table for me:
|
I meant more as: clone repo, But the CMake PR is now merged, so a simple rebase should get you up and running. |
What starship reports in my case: |
GCC lto itself does not do much. Clang LTO, especially thin LTO is much better. |
Maybe these are not what you are looking for, but can be helpful: https://www.phoronix.com/review/clang-lto-kernel |
Clang LTO: Finished at 20:34:56 after 1m3s |
Hyprland isn't that big to be bottlenecked by CPU compilation time on modern systems. I don't think compilation time is the metric that has noticeable regression for us. I meant CPU bottleneck benchmarks for Hyprland to see how much difference it brings in weak systems with iGPUs, where bottleneck might be on CPU side. As LTO is performance optimization, it should decrease Hyprland executable size and increase it's execution speed. I was asking for any benchmarks I can run on slow GPU to test improvements that come with LTO. |
@JohnRTitor Patches for Meson are ready |
I don't know if this is a good idea either, even more so if we don't benchmark it at least and see if there is meaningful improvement. Has anyone tried something to get Hyprland to lag and compare with and without? Maybe a stress test would be a neat idea if someone would like to work on that if it doesn't already exist, also could prove to be useful in improving performance in general without compiler flags if we can profile it. I have compiled my whole system with Gentoo in the past with LTO and NodeJS was the only thing that caused issues so it's somewhat stable I guess but likely still not good idea. But I imagine you might get bigger gains doing |
I think all this conversations about some abstract rick in enabling LTO are pointless. As Hyprland is included in ALHP project already https://status.alhp.dev/?pkgbase=hyprland I don't understand what all the "risk" fuss is about to be fair. |
So are there any actual requirements for being included in ALHP, other than: "it builds, ship it"? I imagine getting this endorsed here officially will take a bit more than that. |
358e59e
to
3fd6c1b
Compare
Describe your PR, what does it fix/add?
Enabled LTO, because why not?
Is there anything you want to mention? (unchecked code, possible bugs, found problems, breaking compatibility, etc.)
No
Is it ready for merging, or does it need work?
It's ready