Artix Linux Forum

Artix Linux => Package management => Topic started by: fabseman on 23 December 2022, 10:56:51

Title: Compiling options
Post by: fabseman on 23 December 2022, 10:56:51
Hi,

I'm just curious to know whether or not you have any plans to start compiling the packages with -O3? If I recall correctly then GCC have a generic O3 option, which should work across almost all CPUs, except ancient ones ;)

Replacing Arch's repos with those from ALHP (https://git.harting.dev/ALHP/ALHP.GO) did provide a noticable performance lift for those packages from that repo - since that was limited to userspace tools, I wonder the potential for Artix' packages compiled with -O3 (and perhaps LTO) :)
Title: Re: Compiling options
Post by: Lancia on 23 December 2022, 12:10:58
Gentoo (https://wiki.gentoo.org/wiki/Handbook:AMD64/Installation/Stage#CFLAGS_and_CXXFLAGS) doesn't recommend enabling it system-wide:
Quote
-O3 is known to cause problems when used system-wide, so we recommend to stick to -O2.

Also (https://wiki.gentoo.org/wiki/GCC_optimization):
Quote
-O3: the highest level of optimization possible. It enables optimizations that are expensive in terms of compile time and memory usage. Compiling with -O3 is not a guaranteed way to improve performance, and in fact, in many cases, can slow down a system due to larger binaries and increased memory usage. -O3 is also known to break several packages. Using -O3 is not recommended. However, it also enables -ftree-vectorize so that loops in the code get vectorized and will use AVX YMM registers.