On Tue, 13 Mar 2001, David O'Brien wrote:

> On Mon, Mar 12, 2001 at 10:34:32PM -0800, Gordon Tetlow wrote:
>                  _           _
>  __/\__    ___  (_)   __ _  | |__     __/\__
>  \    /   / __| | |  / _` | | '_ \    \    /
>  /_  _\   \__ \ | | | (_| | | | | |   /_  _\
>    \/     |___/ |_|  \__, | |_| |_|     \/
>                      |___/

Woohoo! ASCII art!

> > I probably qualify for the latter.... Optimizations are good and all, but
> > I look at it this way: It's a mission critical webserver, I don't want it
> > crashing. As a result, we compile ours with nothing higher that -O2 and no
> > unusual optimizations. Sure, it might be a bit slower than it could have
> > been,
>
> Do people ever actually test this?  Or is there just the assumption that
> the more "optimizations" on the `cc' command line is a Great Thing(tm)?
> People do realize that for some code, -O2 is much worse than -O?  Also
> for much code there is no difference in performance.  Rather than do what
> you "think" will give the best results, why not actually benchmark it?

I was just trying to illustrate that any gains (real or not) realized by
using -O1000 -fomit-everything is generally a trade off between stability
and speed.

> > but we don't have to worry about chasing down compiler bugs that
> > interact strangly with the webserver code. Also, I think anything higher
> > than -O2 actually produces a larger binary (it inlines functions whenever
> > possible).
>
> 1.  You need to use -O if you don't want to chase bugs
> 2.  It is -O2 and above (ie, _includes_ -O2) that produces a larger
>     binary.  See -Os if you want smaller.

Actually, we did. Of course, our production stuff is still compiled with
gcc 2.7.2.1. I think. Whatever the standard system compiler for
FreeBSD-3.2 is. And that was at a time when the world was still compiled
with -O2, wasn't it?

-gordon


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message

Reply via email to