From owner-freebsd-stable@FreeBSD.ORG Thu Sep 14 13:32:40 2006 Return-Path: X-Original-To: freebsd-stable@FreeBSD.ORG Delivered-To: freebsd-stable@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3D5F116A412 for ; Thu, 14 Sep 2006 13:32:40 +0000 (UTC) (envelope-from olli@lurza.secnetix.de) Received: from lurza.secnetix.de (lurza.secnetix.de [83.120.8.8]) by mx1.FreeBSD.org (Postfix) with ESMTP id DD88343D66 for ; Thu, 14 Sep 2006 13:32:36 +0000 (GMT) (envelope-from olli@lurza.secnetix.de) Received: from lurza.secnetix.de (pipknw@localhost [127.0.0.1]) by lurza.secnetix.de (8.13.4/8.13.4) with ESMTP id k8EDWTer048255; Thu, 14 Sep 2006 15:32:35 +0200 (CEST) (envelope-from oliver.fromme@secnetix.de) Received: (from olli@localhost) by lurza.secnetix.de (8.13.4/8.13.1/Submit) id k8EDWTKa048254; Thu, 14 Sep 2006 15:32:29 +0200 (CEST) (envelope-from olli) Date: Thu, 14 Sep 2006 15:32:29 +0200 (CEST) Message-Id: <200609141332.k8EDWTKa048254@lurza.secnetix.de> From: Oliver Fromme To: freebsd-stable@FreeBSD.ORG, kline@sage.thought.org In-Reply-To: <20060913234934.GA92067@thought.org> X-Newsgroups: list.freebsd-stable User-Agent: tin/1.8.0-20051224 ("Ronay") (UNIX) (FreeBSD/4.11-STABLE (i386)) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.1.2 (lurza.secnetix.de [127.0.0.1]); Thu, 14 Sep 2006 15:32:35 +0200 (CEST) Cc: Subject: Re: optimization levels for 6-STABLE build{kernel,world} X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: freebsd-stable@FreeBSD.ORG, kline@sage.thought.org List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Sep 2006 13:32:40 -0000 Gary Kline wrote: > A couple of things. Will having gcc unroll loops have any > negative consequences? Yes. It will make the code slower, in most cases. In modern processors, the loop overhead is almost zero. That's because the "branch prediction unit" of a processor also predicts loop instructions (which are just a special case of conditional branches), and chances are that the whole loop body is in the L1 cache. If it is too large to fit into the L1 cache, then the loop overhead doesn't matter anyhow. There are very, very few special cases where unrolling a small loop might give a little speed improvement. Bit in most cases, it makes things worse. Also, don't expect miracles from -O3. It certainly won't make your kernel run twice as fast, and I even doubt that there would be any measurable difference. Therefore I'm not concerned at all that -O3 isn't officially supported. Best regards Oliver -- Oliver Fromme, secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing Dienstleistungen mit Schwerpunkt FreeBSD: http://www.secnetix.de/bsd Any opinions expressed in this message may be personal to the author and may not necessarily reflect the opinions of secnetix in any way. "C++ is to C as Lung Cancer is to Lung." -- Thomas Funke