Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 10 Dec 2011 11:54:56 +0100
From:      rank1seeker@gmail.com
To:        hackers@freebsd.org
Subject:   Re: CPUTYPE and friends, from 'make.conf' benchmark
Message-ID:  <20111210.105456.372.1@DOMY-PC>
In-Reply-To: <CAGFTUwMEeGPtmJcMXLrCv12xQLXcGcWic5BdUvodiCjHSYAUqw@mail.gmail.com>
References:  <CAGFTUwMEeGPtmJcMXLrCv12xQLXcGcWic5BdUvodiCjHSYAUqw@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help

My home server was also built with 'native' and it's unixbench score was:

231.3 (24.6 min)



# /bin/sh -c "gcc -v -x c -E -mtune=native /dev/null -o /dev/null 2>&1 | grep mtune | sed -e 's/.*mtune=//'"

athlon-4



Here it didn't return 'generic'



Just out of curiosity, I've removed 'native' and left only 'CPUTYPE?=athlon-xp'

After rebuild of OS, it's unixbench score is now:

319.8 (22.4 min)



That is a 38.26%, global speed gain!

Now I'm 100% sure, 'native' should always be avoided!





> It is acceptable to set CPUTYPE and to append certain flags to CFLAGS

> in make.conf, and CPUTYPE is used in many ports for

> architecture-dependent build options.



Default CFLAGS are are '-O2 -pipe'

Which are recommended and proven to be safe?





> The use of CPUTYPE usually has a relatively modest affect on general

> benchmarks in the base system, because a lot of code there is

> intentionally generic, and is compiled with an older toolchain using

> conservative flags, so aggressive optimizations that can take fuller

> advantage of CPU extensions are not used.



I believe because OS stability, is a top priority.



> However, CPUTYPE can have a dramatic affect on certain applications

> when used with appropriate compiler flags (-O3, etc.), particularly

> those in some ports.



So, CPUTYPE is mainly for boosting performance of ported apps.

Regarding compiler flags (-O3, etc.) I use them, only if port offers them.



> 

> b.

> 



Domagoj Smolčić



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20111210.105456.372.1>