Xref: utzoo rec.humor:18717 comp.misc:5027 Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cornell!batcomputer!rpi!leah!bingvaxu!sunybcs!boulder!tramp!loughry From: loughry@tramp.Colorado.EDU (J. Loughry) Newsgroups: rec.humor,comp.misc Subject: Re: Looking for Computer Folklore Summary: Are compilers smart enough to spot benchmarks? Keywords: sieve benchmark microsoft Message-ID: <6507@boulder.Colorado.EDU> Date: 10 Feb 89 03:00:16 GMT Sender: news@boulder.Colorado.EDU Reply-To: loughry@tramp.Colorado.EDU (J. Loughry) Distribution: usa Organization: University of Colorado, Boulder Lines: 28 References: (This is just a rumor, but it's a *neat* rumor....) It seems (allegedly) that certain Microsoft compilers are smart enough to figure out when they are being benchmarked. Any time the parser sees the "standard" 10,000-prime-numbers algorithm, it dumps that section of code and substitutes a set of hand-tuned, gut-level machine code designed to do that one thing as fast as possible! I don't think it actually just printed them out from a table, but you get the idea.... Also: (this is true) One has to be careful when trying to benchmark optimizing compilers. These things *are* smart enough to notice that while you're doing all those expensive floating point calculations, you're never actually doing anything with the answer...so the compiler just figures it all out once, and replaces all the calculations with a simple assignment. Prime Computer once had a compiler optimize their competitor's benchmark down to a single NOP--and for several years they gleefully used this "performance" figure in their ads. ,------------------------------------------------------------------------------, | J. Loughry: loughry@tramp.colorado.edu | "Bigger bombs for a brighter | | (Hey, Evi, you know any more?) | tomorrow!" |`------------------------------------------------------------------------------'