From owner-freebsd-hackers Tue Mar 13 7:41:56 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from dragon.nuxi.com (trang.nuxi.com [209.152.133.57]) by hub.freebsd.org (Postfix) with ESMTP id D4CE437B71B for ; Tue, 13 Mar 2001 07:41:49 -0800 (PST) (envelope-from obrien@NUXI.com) Received: (from obrien@localhost) by dragon.nuxi.com (8.11.3/8.11.1) id f2DFffi75304; Tue, 13 Mar 2001 07:41:41 -0800 (PST) (envelope-from obrien) Date: Tue, 13 Mar 2001 07:41:40 -0800 From: "David O'Brien" To: Gordon Tetlow , Dan Phoenix Cc: freebsd-hackers@FreeBSD.ORG Subject: Re: optimizing apache with php and nfs mounts Message-ID: <20010313074140.B75117@dragon.nuxi.com> Reply-To: freebsd-hackers@FreeBSD.ORG References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: ; from gordont@bluemtn.net on Mon, Mar 12, 2001 at 10:34:32PM -0800 X-Operating-System: FreeBSD 5.0-CURRENT Organization: The NUXI BSD group X-Pgp-Rsa-Fingerprint: B7 4D 3E E9 11 39 5F A3 90 76 5D 69 58 D9 98 7A X-Pgp-Rsa-Keyid: 1024/34F9F9D5 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Mon, Mar 12, 2001 at 10:34:32PM -0800, Gordon Tetlow wrote: > On Mon, 12 Mar 2001, Dan Phoenix wrote: > > > CC="gcc -O6 -fomit-frame-pointer" OPTIM="-O2 -DBUFFERED_LOGS" > > > > could some c guru tell me if this would be bad to use to an apache > > optimization? I need to compile apache on my own not with ports.... > > looking at makefile > > in apache13 in ports collection i see these optimization flags. > > along with --mmap-static module. > > > > > > can you use both -06 and -02 for optmization at the same time? > > -fomit-frame-pointer as well? > > -O6 and -O2 do seem a bit contradictory. I'm guessing it just uses -O6. > -fomit-frame-pointer is not enabled per the -O flags so that does do > something, but it does make it rather difficult to track down problems > without a frame pointer. _ _ __/\__ ___ (_) __ _ | |__ __/\__ \ / / __| | | / _` | | '_ \ \ / /_ _\ \__ \ | | | (_| | | | | | /_ _\ \/ |___/ |_| \__, | |_| |_| \/ |___/ Where did you even get the idea "-O6" did *_ANYTHING_*?? Don't people ever read the documentation anymore. 1. The highest -O setting GCC accepts is "-O3". 2. The base, system C compiler is known to produce bad code with -O2. We have been proclaiming this since as long as I have been with the Project. > 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? > 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. -- -- David (obrien@FreeBSD.org) GNU is Not Unix / Linux Is Not UniX To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message