Enable Link-Time Optimization (LTO) #2931
zamazan4ik
started this conversation in
Ideas
Replies: 1 comment 1 reply
-
This seems like an issue for the specific Fedora distribution package. I do not maintain the Fedora package itself. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi!
I noticed that in the CMake files, LTO is not enabled for CopyQ. Enabling this option allows to a compiler perform more aggressive optimizations which usually lead to a smaller binary and more performant/energy efficient application (since LTO allows to perform more CPU-related optimizations - however I don't think that performance question is too critical for the app). Enabling it in the upstream makes it easier to enable LTO for CopyQ maintainers in OS and allows users who get CopyQ from GitHub Releases to get a more efficient binary.
I have made quick tests with the latest CopyQ version + Fedora 41 + GCC 14.2.1 with the
cmake -DCMAKE_BUILD_TYPE=Release -G Ninja . && ninja
. The default Release binary size is 4.5 Mib, Release + LTO (I have added-flto
toCMAKE_CXX_FLAGS
andCMAKE_EXE_LINKER_FLAGS
) is 4 Mib.Thank you.
Beta Was this translation helpful? Give feedback.
All reactions