I found Os to offer the best all around gcc and with C files.
I tested a large number of string type content files (not float or other numeric calculations) source files
with gcc and with clang. gcc provides a smaller executable than does clang, and Os does much better than O3
I used
CFLAGS := -Os -Wall -Wextra -Fpic -I./includes/ -march=x86-64 -Werror \
-std=gnu11 -fPIC #-Wpedantic #-c -E #--analyze
Make veryclean all strip.
Make veryclean all strip.
veryclean: rm's all objs and excutables.
all: recreates using $cc
strip: removes unnecessary meta stuff around the executables.Savings using -Os are substantial, for my tests, about 400bytes per executable.
Leslie Satenstein
On Thursday, October 31, 2024 at 01:38:01 a.m. EDT, Carlos Rodriguez-Fernandez <carlosrodrifernandez@xxxxxxxxx> wrote:
It would be great to see some empirical analysis about binary size
increase, its impact on RAM consumption, and actual speed benefit,
especially on Fedora. I'm having a hard time finding anything about it.
Regards,
Carlos R.F.
On 10/30/24 7:46 PM, Neal Gompa wrote:
> Hey folks,
>
> I know the idea of moving to -O3 has been briefly mentioned before in
> other contexts when we've discussed uplifting the flags, but it looks
> like Ubuntu is moving to -O3 for Ubuntu 25.04[1]. Is there a reason
> why we shouldn't consider doing the same for Fedora Linux 42?
>
> [1]: https://lists.ubuntu.com/archives/ubuntu-devel/2024-October/043164.html
>
increase, its impact on RAM consumption, and actual speed benefit,
especially on Fedora. I'm having a hard time finding anything about it.
Regards,
Carlos R.F.
On 10/30/24 7:46 PM, Neal Gompa wrote:
> Hey folks,
>
> I know the idea of moving to -O3 has been briefly mentioned before in
> other contexts when we've discussed uplifting the flags, but it looks
> like Ubuntu is moving to -O3 for Ubuntu 25.04[1]. Is there a reason
> why we shouldn't consider doing the same for Fedora Linux 42?
>
> [1]: https://lists.ubuntu.com/archives/ubuntu-devel/2024-October/043164.html
>
--
_______________________________________________
devel mailing list -- devel@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to devel-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/devel@xxxxxxxxxxxxxxxxxxxxxxx
Do not reply to spam, report it: https://pagure.io/fedora-infrastructure/new_issue
_______________________________________________
devel mailing list -- devel@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to devel-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/devel@xxxxxxxxxxxxxxxxxxxxxxx
Do not reply to spam, report it: https://pagure.io/fedora-infrastructure/new_issue
-- _______________________________________________ devel mailing list -- devel@xxxxxxxxxxxxxxxxxxxxxxx To unsubscribe send an email to devel-leave@xxxxxxxxxxxxxxxxxxxxxxx Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/devel@xxxxxxxxxxxxxxxxxxxxxxx Do not reply to spam, report it: https://pagure.io/fedora-infrastructure/new_issue