Forum: NGINX Compiling Nginx with GCC Optimization Flags

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Joe A. (Guest)
on 2008-12-01 23:00
(Received via mailing list)
Has anyone done any testing on the optimum GCC compiler flags for
compiling
Nginx?

I usually use "-O3 -march=core2 -msse -mmmx -msse2 -msse3 -mfpmath=sse
-fomit-frame-pointer", but would it be worthwhile using "-funroll-loops"
or
other options? Would "-O2" be better?

Has anyone compiled Nginx with the Intel C/C++ Compiler? If so, what
settings did you use?

Many thanks!
191919 (Guest)
on 2008-12-02 05:50
(Received via mailing list)
IMHO, nginx default optimizing option (-O) is enough for most cases. If
you
don't have a CPU-stressing module, -O and -O9 make no visible
difference.

2008/12/2 Joe A. <removed_email_address@domain.invalid>
Igor S. (Guest)
on 2008-12-02 11:33
(Received via mailing list)
On Mon, Dec 01, 2008 at 08:49:29PM +0000, Joe A. wrote:

> Has anyone done any testing on the optimum GCC compiler flags for compiling
> Nginx?
>
> I usually use "-O3 -march=core2 -msse -mmmx -msse2 -msse3 -mfpmath=sse
> -fomit-frame-pointer", but would it be worthwhile using "-funroll-loops" or
> other options? Would "-O2" be better?

As it was said there is no noticeable difference between -O and -O2
for nginx. I believe -funroll-loops is useless for nginx: nginx has no
long loops to unroll. For the same reason mmx/sse is useless too:
I saw that Intel C compiler uses them in some loops, but all of them
are short and run once on re/configuration phase only.

-fomit-frame-pointer is single usefull option, but I do not use it
usually
as it makes almost impossible to investigate core dumps.

> Has anyone compiled Nginx with the Intel C/C++ Compiler? If so, what
> settings did you use?

nginx has support for Intel C/C++ Compiler.
It runs with "-O -Ob2 -ip" options.
Joe A. (Guest)
on 2008-12-02 11:54
(Received via mailing list)
Thank you! I would still appreciate hearing anyone else's results also.
This topic is locked and can not be replied to.