From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <199701281122.MAA22192@servix.us.es> Date: Tue, 28 Jan 1997 12:22:34 +0100 From: Claus Denk Subject: Re: compiler efficency Toon Moene wrote: > - Support DEC Alpha (AXP) chip (running Linux, primarily). > (Done.) This sounds fine. When 0.5.20 will be released I'll give it a try. > Besides, to say more about Claus's code example, we need a fully > compilable program module; just a few lines out of context won't > prove anything. Here you go: ( I was just posting the loop, as this is where almost all the time is spent) PROGRAM EULER DOUBLE PRECISION GAM GAM = 1.0d0 NMAX=100000000 DO I=2,NMAX GAM=GAM+1.0d0/dble(I) ENDDO GAM = GAM - DLOG(dble(NMAX)) WRITE(*,*) GAM WRITE(*,*) 'Exact: 0,57721566490153286060' END > the speed difference might be caused by the fact that at the default > optimisation level the Digital Fortran compiler unrolls loops, > whereas g77/gcc won't do that (because this is a CPU architecture > dependent optimisation). Tests were done with -O3 on both gcc and f77. I got on a 433 Mhz 21164/Linux gcc: 12.09 sec. f77: 6.80 sec. On a Pentium 133/Linux I get: f2c+gcc: 40.58 g77 : 39.09 If anyone tries the program, please send me your results (Compiler/Options Machine/OS), so I can add it to my list. regards, Claus -- To unsubscribe: send e-mail to axp-list-request@redhat.com with 'unsubscribe' as the subject. Do not send it to axp-list@redhat.com