From owner-freebsd-questions Thu Dec 5 6: 6:25 2002 Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5F8B237B401 for ; Thu, 5 Dec 2002 06:06:24 -0800 (PST) Received: from HAL9000.homeunix.com (12-232-220-15.client.attbi.com [12.232.220.15]) by mx1.FreeBSD.org (Postfix) with ESMTP id B5EF543E9C for ; Thu, 5 Dec 2002 06:06:23 -0800 (PST) (envelope-from dschultz@uclink.Berkeley.EDU) Received: from HAL9000.homeunix.com (localhost [127.0.0.1]) by HAL9000.homeunix.com (8.12.6/8.12.5) with ESMTP id gB5E6MJt012620; Thu, 5 Dec 2002 06:06:22 -0800 (PST) (envelope-from dschultz@uclink.Berkeley.EDU) Received: (from das@localhost) by HAL9000.homeunix.com (8.12.6/8.12.5/Submit) id gB5E6M2b012619; Thu, 5 Dec 2002 06:06:22 -0800 (PST) (envelope-from dschultz@uclink.Berkeley.EDU) Date: Thu, 5 Dec 2002 06:06:22 -0800 From: David Schultz To: Evren Yurtesen Cc: freebsd-questions@FreeBSD.ORG Subject: Re: -O3 optimization? Message-ID: <20021205140622.GB12456@HAL9000.homeunix.com> Mail-Followup-To: Evren Yurtesen , freebsd-questions@FreeBSD.ORG References: <20021205131130.GB11161@HAL9000.homeunix.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Thus spake Evren Yurtesen : > Well, I made searches from google and people talk that O3 produced quite > noticably faster code. But well I am not so hungry for speed. I just > wondered if the binary might have something wrong with it or not even > though the compiler didnt complain while compiling. > > What about using -O or not using any optimizations? Is it very rare that > -O breaks somethings? I was using -Os and I also didnt notice anything > wrong but maybe there can be something I am missing too... -O is the most widely tested setting, and it is significantly faster than no optimization. The higher optimization levels usually increase performance marginally, but they're still just microoptimizing. Maybe if you were running some compute-intensive scientific software you would see more of a difference. > Is there big performance improvement between -O and -O2 ? or from not > using any optimizations to -O or -O2? Lets say if I am compiling > KDE,XFree86. How much would it effect? is there a web page with some > statistical data about this? I don't know of any serious benchmarks. Try compiling the software in question with -O3. If it works and performs better, great; if you can't tell the difference you might want to be a bit more conservative about the setting... To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message