From owner-freebsd-questions@FreeBSD.ORG Mon Apr 2 22:51:55 2007 Return-Path: X-Original-To: freebsd-questions@FreeBSD.ORG Delivered-To: freebsd-questions@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2CA5516A402 for ; Mon, 2 Apr 2007 22:51:55 +0000 (UTC) (envelope-from kline@tao.thought.org) Received: from tao.thought.org (dsl231-043-140.sea1.dsl.speakeasy.net [216.231.43.140]) by mx1.freebsd.org (Postfix) with ESMTP id 9D4AD13C46A for ; Mon, 2 Apr 2007 22:51:54 +0000 (UTC) (envelope-from kline@tao.thought.org) Received: from tao.thought.org (localhost [127.0.0.1]) by tao.thought.org (8.13.8/8.13.1) with ESMTP id l32Mqs0i036234 for ; Mon, 2 Apr 2007 15:52:55 -0700 (PDT) (envelope-from kline@tao.thought.org) Received: (from kline@localhost) by tao.thought.org (8.13.8/8.13.1/Submit) id l32MqrGq036223 for freebsd-questions@FreeBSD.ORG; Mon, 2 Apr 2007 15:52:53 -0700 (PDT) (envelope-from kline) Date: Mon, 2 Apr 2007 15:52:53 -0700 From: Gary Kline To: FreeBSD Mailing List Message-ID: <20070402225252.GA12822@thought.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.2.2i X-Organization: Thought Unlimited. Public service Unix since 1986. X-Of_Interest: Observing twenty years of service to the Unix community Cc: Subject: comparing the default compilr with gcc-4.2 X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Apr 2007 22:51:55 -0000 Enclosed is one of the first comparsions of gcc-3.4 with no additional switches and gcc-4.2 with the flags -O3 and loop-unrolling set. I'll post a couple more of these; but the nutshell is that is most cases, gcc-4.x seems to be quite an improvment. In this test, I did not try gcc-3.4 with any optimization or loop tweaking. Some people may not care about efficieency. I'll submit my own runs of a floating point test, and another of basicly integer and function call tests. gary /* system gcc, no CFLAGS: gcc -v Using built-in specs. Configured with: FreeBSD/i386 system compiler Thread model: posix gcc version 3.4.6 [FreeBSD] 20060305 */ FLOPS C Program (Double Precision), V2.0 18 Dec 1992 Module Error RunTime MFLOPS (usec) 1 4.0146e-13 0.0511 273.8293 2 -1.4166e-13 0.0461 151.8889 3 4.7184e-14 0.0500 339.8183 4 -1.2557e-13 0.0482 311.0951 5 -1.3800e-13 0.1006 288.2295 6 3.2380e-13 0.0743 390.0978 7 -8.4583e-11 0.1231 97.5168 8 3.4867e-13 0.0791 379.4285 Iterations = 512000000 NullTime (usec) = 0.0040 MFLOPS(1) = 185.4108 MFLOPS(2) = 186.1495 MFLOPS(3) = 277.3309 MFLOPS(4) = 361.6132 /* gcc42 with CFLAGF -O3 -funroll-loops gcc version 4.2.0 20070228 (prerelease) */ FLOPS C Program (Double Precision), V2.0 18 Dec 1992 Module Error RunTime MFLOPS RT inc/(dec) (usec) 1 4.0146e-13 0.0422 332.1242 21.09% 2 -1.4166e-13 0.0399 175.5128 15.54% 3 4.7184e-14 0.0435 391.0462 14.94% 4 -1.2557e-13 0.0436 343.7848 10.55% 5 -1.3800e-13 0.1144 253.5990 31.65% 6 3.2380e-13 0.0818 354.6371 17.20% 7 -8.4583e-11 0.1223 98.1568 01.83% 8 3.4867e-13 0.0912 329.0118 (-27.75%) Iterations = 512000000 NullTime (usec) = 0.0003 MFLOPS(1) = 214.0898 MFLOPS(2) = 186.6407 MFLOPS(3) = 270.9620 MFLOPS(4) = 349.9180 -- Gary Kline kline@thought.org www.thought.org Public Service Unix