From owner-freebsd-hackers@FreeBSD.ORG Sat Dec 10 10:54:59 2011 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 56B351065672 for ; Sat, 10 Dec 2011 10:54:59 +0000 (UTC) (envelope-from rank1seeker@gmail.com) Received: from mail-ey0-f182.google.com (mail-ey0-f182.google.com [209.85.215.182]) by mx1.freebsd.org (Postfix) with ESMTP id D99718FC14 for ; Sat, 10 Dec 2011 10:54:58 +0000 (UTC) Received: by eaai12 with SMTP id i12so2536787eaa.13 for ; Sat, 10 Dec 2011 02:54:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=message-id:from:to:subject:date:content-type :content-transfer-encoding:in-reply-to:references:x-mailer; bh=EYDJP2kQzPiQI0BX3x9VpJpMVqbB695frVpFFfMSPFE=; b=U3vYb1VIfuL16DUtFV2EBQ4BKQyV3pg6IrKYbTeY664341PvFtA5sDi0Gb1mMRhm4/ Xxov9iM5Qh5iggEqqu0WZIqeOZk153UcWGZ2JtPsAvkS+ub6CXbDzbwP66JuGRlhwZUp r9+31CVq4HS/sJUqztuMf7RUxhVxVIxPRYyxM= Received: by 10.213.9.148 with SMTP id l20mr1748057ebl.44.1323514497708; Sat, 10 Dec 2011 02:54:57 -0800 (PST) Received: from DOMYPC ([82.193.208.173]) by mx.google.com with ESMTPS id c9sm44022965eeb.0.2011.12.10.02.54.53 (version=SSLv3 cipher=OTHER); Sat, 10 Dec 2011 02:54:55 -0800 (PST) Message-ID: <20111210.105456.372.1@DOMY-PC> From: rank1seeker@gmail.com To: hackers@freebsd.org Date: Sat, 10 Dec 2011 11:54:56 +0100 Content-Type: text/plain; charset="Windows-1250" Content-Transfer-Encoding: quoted-printable In-Reply-To: References: X-Mailer: POP Peeper (3.8.1.0) Cc: Subject: Re: CPUTYPE and friends, from 'make.conf' benchmark X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Dec 2011 10:54:59 -0000 My home server was also built with 'native' and it's unixbench score = was:=0D=0A231.3 (24.6 min)=0D=0A=0D=0A# /bin/sh -c "gcc -v -x c -E = -mtune=3Dnative /dev/null -o /dev/null 2>&1 | grep mtune | sed -e = 's/.*mtune=3D//'"=0D=0Aathlon-4=0D=0A=0D=0AHere it didn't return = 'generic'=0D=0A=0D=0AJust out of curiosity, I've removed 'native' and = left only 'CPUTYPE?=3Dathlon-xp'=0D=0AAfter rebuild of OS, it's unixbench = score is now:=0D=0A319.8 (22.4 min)=0D=0A=0D=0AThat is a 38.26%, global = speed gain!=0D=0ANow I'm 100% sure, 'native' should always be = avoided!=0D=0A=0D=0A=0D=0A> It is acceptable to set CPUTYPE and to append = certain flags to CFLAGS=0D=0A> in make.conf, and CPUTYPE is used in many = ports for=0D=0A> architecture-dependent build options.=0D=0A=0D=0ADefault = CFLAGS are are '-O2 -pipe'=0D=0AWhich are recommended and proven to be = safe?=0D=0A=0D=0A=0D=0A> The use of CPUTYPE usually has a relatively = modest affect on general=0D=0A> benchmarks in the base system, because a = lot of code there is=0D=0A> intentionally generic, and is compiled with = an older toolchain using=0D=0A> conservative flags, so aggressive = optimizations that can take fuller=0D=0A> advantage of CPU extensions are = not used.=0D=0A=0D=0AI believe because OS stability, is a top = priority.=0D=0A=0D=0A> However, CPUTYPE can have a dramatic affect on = certain applications=0D=0A> when used with appropriate compiler flags = (-O3, etc.), particularly=0D=0A> those in some ports.=0D=0A=0D=0ASo, = CPUTYPE is mainly for boosting performance of ported apps.=0D=0ARegarding = compiler flags (-O3, etc.) I use them, only if port offers = them.=0D=0A=0D=0A> =0D=0A> b.=0D=0A> =0D=0A=0D=0ADomagoj Smol=E8i=E6