home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!spool.mu.edu!uwm.edu!ogicse!das-news.harvard.edu!spdcc!iecc!compilers-sender
- From: hrubin@pop.stat.purdue.edu (Herman Rubin)
- Newsgroups: comp.compilers
- Subject: Re: static estimation of conditional branches?
- Keywords: optimize, comment
- Message-ID: <92-12-055@comp.compilers>
- Date: 13 Dec 92 18:20:49 GMT
- Article-I.D.: comp.92-12-055
- References: <92-12-029@comp.compilers> <92-12-054@comp.compilers>
- Sender: compilers-sender@iecc.cambridge.ma.us
- Reply-To: hrubin@pop.stat.purdue.edu (Herman Rubin)
- Organization: Purdue University Statistics Department
- Lines: 40
- Approved: compilers@iecc.cambridge.ma.us
-
-
- idacrd!desj@uunet.UU.NET (David desJardins) writes:
- >... any programmer who is making a serious effort to write high-
- >performance code must know approximately how often each of the conditional
- >branches in critical sections is taken...
-
- henry@zoo.toronto.edu (Henry Spencer) writes:
- >I agree with this statement, with one crucial substitution: for "must"
- >read "should", in the sense of "you should stay below the speed limit".
-
- >When people first started implementing profilers and the like, they found
- >one striking result: human intuition about the locations of the hot spots
- >in a complex program was *consistently wrong*. ...
-
- There are many stiuations in which one KNOWS how often branches are taken,
- even if one does not know, for various reasons, how much time is spent in
- a given kind of operation. When I post an algorithm for generating a kind
- of non-uniform random variable, if my reasoned estimates of how often each
- branch is done is off by more than roundoff, it is because the uniform
- input is not random. If profiling finds anything different, either I have
- miscalculated or the input uniform random numbers do not have the
- properties they are supposed to have.
-
- There are many other cases of this. In numerical work, one might easily
- misguess on which major class of cases is most common, but one is not
- likely to be far off on what is happening locally. Even someone fairly
- adept at numerical analysis will recognize what is known and what is not.
-
- One should not design a language, or a compiler, so that a fool can use it
- "properly." In that case, it is quite likely that nobody can use it at a
- higher level than the fool. Design it for the genius first, and then put
- in the cautions, etc., for the fool.
- --
- Herman Rubin, Dept. of Statistics, Purdue Univ., West Lafayette IN47907-1399
- Phone: (317)494-6054 hrubin@snap.stat.purdue.edu (Internet, bitnet)
- {purdue,pur-ee}!snap.stat!hrubin(UUCP)
- [I'd go the other way. Geniuses are a lot more flexible than fools. -John]
- --
- Send compilers articles to compilers@iecc.cambridge.ma.us or
- {ima | spdcc | world}!iecc!compilers. Meta-mail to compilers-request.
-