On Mon, Dec 5, 2011 at 12:19 PM, Garrett Cooper <yaneg...@gmail.com> wrote: > 2011/12/5 <rank1see...@gmail.com>: >> I've took machine and installed binary FreeBSD(amd64 8.2-p4 GENERIC) on it. >> Then I've installed 'benchmarks/unixbench' port. >> >> So everything is a default generic binary install ('make.conf' empty - no >> CPU optimization flags) >> >> After running: '# time unixbench', final score was: >> 394.2 >> Completed in 22.8 min >> >> >> Then I've recompiled everything, from src, world and kernel, with >> 'make.conf': >> -- >> CPUTYPE?=core2 >> CFLAGS+=-march=native >> NO_CPU_CFLAGS=yes >> COPTFLAGS+=-march=native >> NO_CPU_COPTFLAGS=yes >> -- >> >> After reboot, I've run: '# time unixbench', final score was: >> 313.5 >> Completed in 26.7 min >> >> I'm getting worse result, with optimized FreeBSD's binaries?!? >> How come? > > Seems like -march=native is redundant. > -Garrett
Not only is it redundant, but it might be undoing to effects of CPUTYPE. Run the following command, it tells you what gcc ends up optimizing for when you use -march=native: /bin/sh -c "gcc -v -x c -E -mtune=native /dev/null -o /dev/null 2>&1 | grep mtune | sed -e 's/.*mtune=//'" On most of my machines, native is the same as generic. Rerun your test with just 'CPUTYPE?=core2' line in make.conf and see what the results are. Usually, there is no need to specify any other options. Also, in 8.2 'core2' seems to be an alias for 'prescott'. You have to use FreeBSD 9.0 for core2 to be available in gcc. - Max _______________________________________________ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"