From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (qmail 3097 invoked from network); 3 Jan 1999 20:58:00 -0000 Received: from mail.redhat.com (199.183.24.239) by lists.redhat.com with SMTP; 3 Jan 1999 20:58:00 -0000 Received: from paralleldata.com (smtp.paralleldata.com [38.153.145.2]) by mail.redhat.com (8.8.7/8.8.7) with ESMTP id PAA13615 for ; Sun, 3 Jan 1999 15:40:08 -0500 Received: by paralleldata.com from localhost (router,SLMail V2.5); Sun, 03 Jan 1999 14:42:28 -0600 Received: by paralleldata.com from paralleldata.com (207.158.82.45::mail daemon; unverified,SLMail V2.5); Sun, 03 Jan 1999 14:42:27 -0600 Sender: "Wsb" Message-ID: <368FE4E8.9F66FAE6@paralleldata.com> Date: Sun, 03 Jan 1999 21:45:12 +0000 From: "Wes Bauske" Organization: Parallel Data Systems X-Mailer: Mozilla 4.04 [en] (X11; U; Linux 2.0.33 i686) MIME-Version: 1.0 To: axp-list@redhat.com Subject: Re: Performance again References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Herwin Jan Steehouwer wrote: > > oops, i forgot the source : > Herwin, I ran your test on my 533 PC164LX but the loop was optimized out of the code. All tests, i/f/d were 0.03 seconds WCT. So, you need a little change to the test t make the compiler run the loops. Just print out the last value of val1 in your print statements. This forces the compiler to really calculate the loop. I got the following results with that change: [wsb@wsb5 home]$ time preftest d double val1=2 0.24user 0.00system 0:00.25elapsed 98%CPU (0avgtext+0avgdata 0maxresident)k 0inputs+0outputs (68major+13minor)pagefaults 0swaps [wsb@wsb5 home]$ time preftest i mixed int val1=2.000000 2.01user 0.00system 0:02.02elapsed 99%CPU (0avgtext+0avgdata 0maxresident)k 0inputs+0outputs (68major+13minor)pagefaults 0swaps [wsb@wsb5 home]$ time preftest f float val1=2.000000 0.18user 0.00system 0:00.18elapsed 98%CPU (0avgtext+0avgdata 0maxresident)k 0inputs+0outputs (68major+13minor)pagefaults 0swaps Also, I used gcc -O2 : gcc version egcs-2.90.29 980515 (egcs-1.0.3 release) Watch out though how you use the results. This test is way too simple to represent a real application. Most likely almost all the work was moved out of the loop because it doesn't vary from iteration to iteration. Wes