From owner-freebsd-hackers@FreeBSD.ORG Sat Feb 14 00:24:33 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E10C416A4CE for ; Sat, 14 Feb 2004 00:24:33 -0800 (PST) Received: from kurush.osdn.org.ua (external.osdn.org.ua [212.40.34.156]) by mx1.FreeBSD.org (Postfix) with ESMTP id A9DAD43D1F for ; Sat, 14 Feb 2004 00:24:32 -0800 (PST) (envelope-from never@kurush.osdn.org.ua) Received: from kurush.osdn.org.ua (never@localhost [127.0.0.1]) by kurush.osdn.org.ua (8.12.6p3/8.12.6) with ESMTP id i1E8OTq3083383; Sat, 14 Feb 2004 10:24:29 +0200 (EET) (envelope-from never@kurush.osdn.org.ua) Received: (from never@localhost) by kurush.osdn.org.ua (8.12.6p3/8.12.6/Submit) id i1E8OLbf082977; Sat, 14 Feb 2004 10:24:21 +0200 (EET) (envelope-from never) Date: Sat, 14 Feb 2004 10:24:21 +0200 From: Alexandr Kovalenko To: Wes Peters Message-ID: <20040214082420.GB77411@nevermind.kiev.ua> References: <200402101129.34337.wes@softweyr.com> Mime-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <200402101129.34337.wes@softweyr.com> User-Agent: Mutt/1.5.4i cc: freebsd-hackers@freebsd.org cc: Juan Tumani Subject: Re: FreeBSD 5.2 v/s FreeBSD 4.9 MFLOPS performance (gcc3.3.3 v/s gcc2.9.5) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Feb 2004 08:24:34 -0000 Hello, Wes Peters! On Tue, Feb 10, 2004 at 11:29:34AM -0800, you wrote: > On Monday 09 February 2004 13:20, Juan Tumani wrote: > > I have an Intel D845GE m/b w/ a P4 1.7 CPU and I have the box setup > > to dual boot to either 4.9 or 5.2. Both OS are right off the latest > > posted iso CD image, i.e., no updates, no kernel tweaks, everything > > vanilla right out of the box. I compiled flops.c on both 4.9 and > > 5.2 and the 5.2 performance is less than half that of 4.9: 760 > > MFLOPS on 4.9 v/s 340 MFLOPS on 5.2. > > > > I tried turning off the SMP and other kernel tweaks and no > > improvement in 5.2. I then downloaded and installed gcc295 on the > > 5.2 machine and that fixed the problem. So now all I have to do is > > figure out the gcc 3.3.3 switches to make it run like gcc 2.9.5 or > > figure out how to rebuild 5.2 w/ gcc 2.9.5 :-). > > I'm not sure that kernel tweaks are going to make much difference on a > single-threaded floating point benchmark. Compiler optimizations sure > do, though. (Note: I couldn't find version 1.2 of flops.c, so this is > based on version 2.0.) On a 2.0GHz P4, I see: > > wpeters@salty> cc -o flops -O -DUNIX flops.c Could you please explain me this? Result is fully reproduceable. Please note, that the only difference is the output file name. Even resulting files match bit-to-bit. If I do mv flucking-slow-flops flops2 and then run ./flops2, it runs as flops2 - fast. Machine is Dual 2.8 GHz Xeon with HTT disabled (in BIOS). FreeBSD is 5.2.1-RC2. %fetch http://home.iae.nl/users/mhx/flops.c Receiving flops.c (34942 bytes): 100% 34942 bytes transferred in 0.6 seconds (54.72 kBps) %cc -o flops2 -O2 -mcpu=pentium4 -DUNIX flops.c flops.c: In function `main': flops.c:174: warning: return type of `main' is not `int' %cc -o flops-sse-4 -O2 -mcpu=pentium4 -DUNIX flops.c flops.c: In function `main': flops.c:174: warning: return type of `main' is not `int' %cc -o fucking-slow-flops -O2 -mcpu=pentium4 -DUNIX flops.c flops.c: In function `main': flops.c:174: warning: return type of `main' is not `int' %./flops2 FLOPS C Program (Double Precision), V2.0 18 Dec 1992 Module Error RunTime MFLOPS (usec) 1 4.0146e-13 0.0130 1074.8815 2 -1.4166e-13 0.0128 545.3338 3 4.7184e-14 0.0177 960.4579 4 -1.2557e-13 0.0166 903.6914 5 -1.3800e-13 0.0317 915.0687 6 3.2380e-13 0.0310 936.3149 7 -8.4583e-11 0.0403 297.7250 8 3.4867e-13 0.0310 968.6112 Iterations = 512000000 NullTime (usec) = 0.0006 MFLOPS(1) = 635.0698 MFLOPS(2) = 560.4516 MFLOPS(3) = 805.4502 MFLOPS(4) = 945.5219 %./flops-sse-4 FLOPS C Program (Double Precision), V2.0 18 Dec 1992 Module Error RunTime MFLOPS (usec) 1 4.0146e-13 0.0177 791.6075 2 -1.4166e-13 0.0309 226.7944 3 4.7184e-14 0.0202 842.7146 4 -1.2557e-13 0.0166 902.8921 5 -1.3800e-13 0.0317 916.2631 6 3.2380e-13 0.0309 937.0923 7 -8.4583e-11 0.0403 297.9173 8 3.4867e-13 0.0309 969.3446 Iterations = 512000000 NullTime (usec) = 0.0006 MFLOPS(1) = 297.9983 MFLOPS(2) = 546.3944 MFLOPS(3) = 775.3701 MFLOPS(4) = 922.1566 %./fucking-slow-flops FLOPS C Program (Double Precision), V2.0 18 Dec 1992 Module Error RunTime MFLOPS (usec) 1 4.0146e-13 0.0317 442.0039 2 -1.4166e-13 0.0331 211.3728 3 4.7184e-14 0.0350 485.1899 4 -1.2557e-13 0.0168 892.8307 5 -1.3800e-13 0.0319 909.7385 6 3.2380e-13 0.0311 931.1527 7 -8.4583e-11 0.0405 296.4570 8 3.4867e-13 0.0312 962.3224 Iterations = 512000000 NullTime (usec) = 0.0004 MFLOPS(1) = 259.1938 MFLOPS(2) = 492.7930 MFLOPS(3) = 669.1527 MFLOPS(4) = 797.1471 -- NEVE-RIPE, will build world for food Ukrainian FreeBSD User Group http://uafug.org.ua/