[Slackbuilds-users] Optimizing X86-64 builds

David Spencer baildon.research at googlemail.com
Sat Feb 10 21:47:05 UTC 2018

>   When running SlackBuild scripts for x86-64 installations, the optimization
> flags are -O2 -fPIC.  Would there be any advantage to adding flags depending
> on the processor used?  If so, is there any convenient way to do this in the
> SlackBuild script?

Hi Ira,

The traditional answer is that tuning for the specific processor
(-march=native) doesn't make much difference on x86_64.

Changing the compiler optimisation from -O2 to -O3 might plausibly
make a measurable difference, depending on the specific package.
Slackware traditionally uses -O2, which reflects Patrick's
long-standing preference for stability over performance. SBo follows
that precedent. Most other distros mostly use -O3, fwiw. There are a
few packages in both Slackware and SBo (where -O2 is buggy, or not
recommended upstream, or it's difficult to force -O2) that use
something else.

It would be very interesting if someone did some carefully performed
up-to-date benchmarks to see what difference there really is. Until
someone gives us some numbers, we see more advantage in keeping the
scripts (mostly) consistent.  There isn't any convenient way of
changing the flags -- but, like anything else, if someone made a
really really good case, we might be open to a rethink.


More information about the SlackBuilds-users mailing list