-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Disable IPO on all targets #3589
Conversation
…targets if appropriated.
Do we plan to release with debug info? I think we should. In that case, this is somewhat pointless. |
now we have a new warning: |
For a local development environment incremental linking is what you need! For builds, you distribute, there is no benefit in incremental linked binaries, but they have a significiantly larger filesize. |
@JoergAtGithub Thank you for the issue. What does it mean for the PDB file installer feature and Mixxx performance. I want to make it possible that the user is able to create back-traces with source file line numbers from crash dumps or debug sessions. This should not affect the performance of Mixxx. The file size of the Mixxx binary is not that important Imho, the question is how the size of the distributes installer is affected and if the Required RAM changes. Can you please check how the situation is for #3576 I can issue another PR with ipo disabled for compare. |
How does this tip relate to us? |
Debug symbols (PDB-files) should work independend of this. But in general if you use compiler optimization, it can be that code section are removed or are replaced by more efficient code. Than this code section will not occur in your stack trace. With IPO, this optimizations will be done at much more places. This is because the optimization happens at link time instead of compile time, where the linker has the big picture. In general there are three possibilities (each work with different optimization levels -Ox): |
I will check with a local mock build if the situation has changed. Next release. |
Debian Focal: |
The IPO version runs without a crash on Ubuntu Focal |
In https://bugzilla.rpmfusion.org/show_bug.cgi?id=5829 it's written, that "even the unit tests are already crashing, although that previously worked". |
Ah OK, that's fortune. So the remaining question is, do we get backtraces with line numbers if we enable IPO using the PDB file in the installer? Here is the alternative with IPO disabled: If it works with IPO, i suggest to enable IPO for Release and RelWithDebInfo and disable it for Debug. |
Is there than a point for "fastbuild" anymore? |
This makes sense for me! |
Please remove the target "fastbuild" also from https://github.com/mixxxdj/mixxx/blob/main/tools/windows_buildenv.bat |
e675de0
to
b5d9531
Compare
… IPO except for Debug Builds.
This is too hard for me without a windows machine. "fastbuild" has now become "Native + Debug" this should produce the best developer experience. |
CMakeLists.txt
Outdated
# CMAKE_INTERPROCEDURAL_OPTIMIZATION can be defined to override the default behaviour. | ||
# We keep DEFINED CMAKE_INTERPROCEDURAL_OPTIMIZATION unset = FALSE for Debug builds to save | ||
# build time during development at the cost of a bigger memory foodprint. | ||
# Note: This is has caused issues on Fedoa https://bugzilla.rpmfusion.org/show_bug.cgi?id=5829 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# Note: This is has caused issues on Fedoa https://bugzilla.rpmfusion.org/show_bug.cgi?id=5829 | |
# Note: This is has caused issues on Fedora https://bugzilla.rpmfusion.org/show_bug.cgi?id=5829 |
CMakeLists.txt
Outdated
# We keep DEFINED CMAKE_INTERPROCEDURAL_OPTIMIZATION unset = FALSE for Debug builds to save | ||
# build time during development at the cost of a bigger memory foodprint. | ||
# Note: This is has caused issues on Fedoa https://bugzilla.rpmfusion.org/show_bug.cgi?id=5829 | ||
if(NOT DEFINED CMAKE_INTERPROCEDURAL_OPTIMIZATION AND NOT CMAKE_BUILD_TYPE STREQUAL "Debug" AND NOT OPTIMIZE STREQUAL "off") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if(NOT DEFINED CMAKE_INTERPROCEDURAL_OPTIMIZATION AND NOT CMAKE_BUILD_TYPE STREQUAL "Debug" AND NOT OPTIMIZE STREQUAL "off") | |
if(NOT DEFINED CMAKE_INTERPROCEDURAL_OPTIMIZATION AND NOT CMAKE_BUILD_TYPE STREQUAL "Debug" AND NOT OPTIMIZE) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If optimize is not set, CMake shoukd fail below. It defaults to "portable"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess using STREQUAL is correct here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Holzhaus Your opinion?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with @daschuer. Command line arguments in CMake have a type (you can check with cmake -L
):
OPTIMIZE:STRING=portable
So we shouldn't mix different types and use STREQUAL throughout.
CMakeLists.txt
Outdated
|
||
# CMAKE_INTERPROCEDURAL_OPTIMIZATION can be defined to override the default behaviour. | ||
# We keep DEFINED CMAKE_INTERPROCEDURAL_OPTIMIZATION unset = FALSE for Debug builds to save | ||
# build time during development at the cost of a bigger memory foodprint. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the higher memory requirement at build time or run time? Please clarify the comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At run time.
Is the OPTIMIZE CMake option now effectively a binary? If so, let's treat it as such and use ON/OFF and get rid of the "portable" string. |
Done! |
Done |
So maybe only use IPO for Release build type and everything else use INCREMENTAL? Then we could do RelWithDebInfo builds on GH Actions and cache the CMake build directory since we haven't gotten clcache to work. |
We can ignore "Release" because we need the debug info for the symbol files on each of our targets. The idea was to use Debug for development and RelWithDebInfo for our releases. I am in doubt that IPO makes Mixxx faster. It removes anyway unused .text segment. That will improve the start up and limit the memory footprint. However the .text segment is small compared to the heap we use. See here: I don't mind if we disable Ipo always. |
IMHO IPO should be enabled for the official release builds and INCREMENTAL (default) for local development builds. For the GitHub CI builds, we should use, whatever provides the fastest build times. |
That using a different compilers settings for CI than release is IMHO not a good idea because, than we will release an almost untested release. Do you have measures that reveals difference s in run-time speed? |
Please resolve the minor conflicts. Anything else to do here? |
The PR is done. The useful part is at least that IPO is no accessible as a cmake parameter. I am really not sure if the extra CPU time outweighs the smaller binary. Currently IPO is enabled for RelWithdebInfo builds, we want to release. |
I don't think the extra CPU time on CI is worth the tradeoff. The Ubuntu 18.04 build took 29m 53s with a compiler cache. It normally takes ~5 minutes. So I think we should close this without merging.
|
Did you compare two consecutive builds? I think we should merge this at any case, because it equalizes the settings of all our tragets. |
Yes, I posted the |
The macOS build took 1 hour with cache hits 😬
Maybe IPO is why we haven't gotten clcache nor sccache to work? |
How many previous builds are covered by ccache -s? |
Good question. I manually reran the last builds to double check. Let's see how it goes... |
Repeat build times: IMO the increased build time for macOS makes this not worth it. |
…ment for documentation purpose.
IPO is now disabled, the comments are kept for future reference. |
Windows build is down to 32 minutes without caching. 👍 |
I don't think the compiler flags are getting applied as intended. Look at the sccache log in https://github.com/mixxxdj/mixxx/runs/1981578442 |
What issue do you see? |
Did you expect to see /Z7? You don't see it, because you have added you patch into the optimize=off region. |
Oh, good catch. |
There is now a warning on Windows:
|
Looking for a solution for this warning on windows,
I have found that CMake has a generic solution for all targets, controlled by CMAKE_INTERPROCEDURAL_OPTIMIZATION
It turns out that IPO was only enabled for windows. I think If we want it enabled it should be done for all targets. However, I am not sure what it means for our build time and for the Mixx performance.
If it is only a matter of the size of the binary, we may consider to disable it for all.
What do you think?
On linux it add the options:
-flto -fno-fat-lto-objects