home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / sys / next / programm / 5356 < prev    next >
Encoding:
Internet Message Format  |  1992-07-30  |  997 b 

  1. Path: sparky!uunet!decwrl!bu.edu!Shiva.COM!world!gsk
  2. From: gsk@world.std.com (Geoffrey S Knauth)
  3. Newsgroups: comp.sys.next.programmer
  4. Subject: Re: usleep and efficiency
  5. Message-ID: <Bs75rr.Ivp@world.std.com>
  6. Date: 30 Jul 92 10:14:14 GMT
  7. References: <2A778A16.26787@noiro.acs.uci.edu>
  8. Organization: The World Public Access UNIX, Brookline, MA
  9. Lines: 11
  10.  
  11. In article <2A778A16.26787@noiro.acs.uci.edu> rmyers@dec5200.acs.uci.edu (Richard Myers) writes:
  12. >2. Is there an EASY way of finding out which way to code a line faster.
  13. >eg. should I say if 'fabs(x) > 2' or '(x > 2.0) || (x < -2.0)'?  I'd like
  14. >a faster way to test this than doing a full profile run!
  15. >[BTW, the second way is faster].
  16.  
  17. The easiest way is to remember that fabs() is a function, not a macro,
  18. and hence has more overhead than the second, more explicit expression.
  19. -- 
  20. Geoffrey S. Knauth, Marble Associates, Inc.                Member BCS-NeXT, LPF
  21. gsk@marble.com, (617) 891-5555 work, (617) 547-5247 home   Standard Disclaimers
  22.