-
-
Notifications
You must be signed in to change notification settings - Fork 749
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
ci: Use link-time optimization for building #1636
Conversation
This shouldnt apply to debug builds |
IMO it would be good to wrap this in some variable check so its off by default for anyone building locally but can be enabled by -Dwhatever for github builds |
This is a user preference, you should just pass |
So this config it better set in GitHub CI instead? |
Yes, like every other build preferences (compiler, optimization level, etc.), or in a |
Missing |
Thanks for the thint. Updated the PR: following your recommendations I enabled LTO in the GH action instead of CMakeLists.txt in order to leave the option of building with having it disabled for people compiling the project locally. |
You can put |
6441f90
to
42d9acc
Compare
@abouvier thanks for the hint. Compiled locally, behaves as expected. |
See https://cmake.org/cmake/help/latest/variable/CMAKE_POLICY_DEFAULT_CMPNNNN.html |
I read some documentation and was able to verify that CMAKE_POLICY_DEFAULT_CMPNNNN makes more sense here. Updated accordingly. Thanks. |
should this use -DCMAKE_INTERPROCEDURAL_OPTIMIZATION_RELEASE instead? dont think there are non-release builds on this repo's actions but maybe good idea |
* This enables LTO also when building external dependencies that do not handle CMP0069 in their CMake scripts.
I also think that the action will only be used for building "release" config but it does not hurt to only enable LTO for specifically that config. Thanks for the hint, I updated the PR. |
Anything else that needs to be addressed? |
@georgemoralis may I ask about the status of this PR? Does it need further testing? Can be merged into main? |
This PR in its current form will only enable LTO for release builds (as per cmake configuration). shadPS4's CI is currently always building release configuration. LTO would always be included for CI builds as of the current state of this PR. This should be fine as CMake flag "INTERPROCEDURAL_OPTIMIZATION" will opt for Thin-LTO and never use Fat/Full-LTO. Due to this the build time does only increase a little. |
This PR enables LTO if the respective build toolchain supports it.
During my tests LTO enabled builds of shadPS4 performed noticeably better in certain games (e.g. Bloodborne).
Especially 1% low FPS measurement results were better and perceived stutter was less.
This observation was backed by other testers that were given a test build by me.