From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 110292,148db191ef7ef08a X-Google-Attributes: gid110292,public X-Google-Thread: 1164f8,148db191ef7ef08a X-Google-Attributes: gid1164f8,public X-Google-Thread: 102b75,10f70e989313f8fc X-Google-Attributes: gid102b75,public From: Patrick F. McGehearty Subject: Re: Why the CPQ AlphaServer DS20 Flies on FP (was Re: HP PA-8500 fp performance: Ugh!) Date: 1999/01/17 Message-ID: <77tngo$4ms@deadzone.rsn.hp.com>#1/1 X-Deja-AN: 433770386 Sender: patrick@rsn.hp.com References: <369E4B0C.A3A3D85E@moene.indiv.nluug.nl> <77o21h$3pl@news1.newsguy.com> <36A07DD3.D268F09E@moene.indiv.nluug.nl> Organization: Hewlett Packard, Richardson, Tx USA Reply-To: patrick@rsn.hp.COM (Patrick F. McGehearty) Newsgroups: comp.arch,comp.sys.dec,comp.sys.intel In article <36A07DD3.D268F09E@moene.indiv.nluug.nl>, Toon Moene wrote: >Greg Lindahl wrote: >> >> Toon Moene writes: >> >> > Another look at these results (and especially the relatively large >> > difference between base and peak SPECfp95) is to note that this >> > benchmark set is nearing the end of its useful life. >> > >> > Apparently so much is nowadays known about the way to have compilers >> > spit out good/better/best code for these ten programs, that only the >> > base result is relevant for real world comparison. >> >> This criticism is unfair. In order to conclude that, you would have to >> take a large body of real-world programs, try some of the `peak' >> optimizations on them, and show that no real-world program benefits >> from the weird flags that help SPEC benchmark programs. In this >> example (Compaq DS20), most of the weird flags are for the KAP tool; >> the Digital Fortran flags are simple things like "-speculate all", >> "-inline none", "-transform_loops", "-unroll 8". > >Although I agree with you in principle, I get really uneasy when just >adding a set of flags to a compile statement one can get a twofold >increase in performance (this happens on some of the tests - turb3d, and >in a lesser way - su2cor). > >This is not something I see in practice. > >-- >Toon Moene (toon@moene.indiv.nluug.nl) >Saturnushof 14, 3738 XG Maartensdijk, The Netherlands >Phone: +31 346 214290; Fax: +31 346 214286 >g77 Support: fortran@gnu.org; egcs: egcs-bugs@cygnus.com It may be the codes that Toon uses are already well written to be relatively easy for the compiler to generate good code. In my role as compiler performance analyst, I regularly see codes where the flags chosen can vary application performance by factors of two or more. Take the HP flag "+Odataprefetch". Using means that inner loops will include an additional pre-load instruction for every 4 or 8 direct loads (32 byte cache lines mean 4 real*8 or 8 real*4 data items per cache line prefetched). Not using means the prefetches are not included. Adding prefetching to a loop who's data is in cache causes it to run approximately 10% slower. Failing to add prefetching to a loop who's data in not in cache causes it to run approximately 50% faster. So there is no "optimal for all programs" setting for the flag. With a few more similar effects, it is not hard to see that flags can cause more than a factor of two in application performance. I maintain a suite of hundreds of performance test loops taken from many sources. The average test runs 20 times faster at full optimization than with no optimization. Some only show 5 times improvement while others show even more improvement. And I'm only talking about the difference between +O0 and +O3. Special flags can make even greater differences. So if you really care about the performance of your application, it pays to spend some time learning about compiler optimization flags (or paying someone else to do it for you). Depending only base optimization flags is like having a turbocharger built into your car and then disabling it. - Patrick McGehearty patrick@rsn.hp.com