<div dir="ltr"><div>I made a non-scientific benchmark on my laptop with my project. Although jumping from -O2 to -Ofast giving me dramatic speed boost, it's interesting to see that going from gcc-4.9 to clang-3.9, there's no difference, just margin of error. The test is non-scientific, I worked on my PC at midday on raw pictures, lots of programs open, but still, those readings almost identical.<br><br></div>My verdict is there's no reason to introduce clang into my Docker build, because doesn't make any speed difference. Going from -O2 to -Ofast makes. 290-310req/s vs 380-450 req/s.<br></div><div class="gmail_extra"><br><div class="gmail_quote">2016-07-08 15:22 GMT+02:00 Lantos István <span dir="ltr"><<a href="mailto:kerozin.joe@gmail.com" target="_blank">kerozin.joe@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Thank You!<br></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">2016-07-08 15:20 GMT+02:00 Valentin V. Bartenev <span dir="ltr"><<a href="mailto:vbart@nginx.com" target="_blank">vbart@nginx.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span>On Friday 08 July 2016 14:44:00 Lantos István wrote:<br>
> The default --with-cc-opt flags for Nginx are these:<br>
><br>
</span>> *--with-cc-opt='-g -O2 -fstack-protector-strong -Wformat<br>
> > -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2'*<br>
<span>> ><br>
><br>
> However I added more optimizations, which are against the standard:<br>
><br>
</span>> *--with-cc-opt='-g -Ofast -march=native -ffast-math<br>
> > -fstack-protector-strong -Wformat -Werror=format-security<br>
> > -Wp,-D_FORTIFY_SOURCE=2'*<br>
<span>> ><br>
><br>
> So far I don't experience any bug, but I do have a higher benchmark:<br>
> 380-450 req/s compared to the original 290-310 req/s with cached<br>
> Node/Express app on my laptop.<br>
><br>
> Is it safe to use -O3 or -Ofast flags with Nginx?<br>
<br>
</span>Usually it is safe.  You can run tests: <a href="http://hg.nginx.org/nginx-tests/" rel="noreferrer" target="_blank">http://hg.nginx.org/nginx-tests/</a><br>
<span><br>
><br>
> Is it possible to build Nginx with clang? If so, should I symlink it to gcc<br>
> (I use Docker, this way gcc executable is trashed) or is there a way to<br>
> define the compiler with a flag?<br>
<br>
</span>  --with-cc=<br>
<br>
  wbr, Valentin V. Bartenev<br>
<br>
_______________________________________________<br>
nginx mailing list<br>
<a href="mailto:nginx@nginx.org" target="_blank">nginx@nginx.org</a><br>
<a href="http://mailman.nginx.org/mailman/listinfo/nginx" rel="noreferrer" target="_blank">http://mailman.nginx.org/mailman/listinfo/nginx</a><br>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div>