🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.next.programmer
Article #347

Re: usleep and efficiency

#347
From: Geoffrey S Knauth
Date: Thu, 30 Jul 1992 10:14
11 lines
1018 bytes
In article <2A778A16.26787@noiro.acs.uci.edu> rmyers@dec5200.acs.uci.edu (Richard Myers) writes:
>2. Is there an EASY way of finding out which way to code a line faster.
>eg. should I say if 'fabs(x) > 2' or '(x > 2.0) || (x < -2.0)'?  I'd like
>a faster way to test this than doing a full profile run!
>[BTW, the second way is faster].

The easiest way is to remember that fabs() is a function, not a macro,
and hence has more overhead than the second, more explicit expression.
-- 
Geoffrey S. Knauth, Marble Associates, Inc.                Member BCS-NeXT, LPF
gsk@marble.com, (617) 891-5555 work, (617) 547-5247 home   Standard Disclaimers
Technical Details
Message-ID: <Bs75rr.Ivp@world.std.com>
Path: arc1-ca.pugleaf.net!sparky!uunet!decwrl!bu.edu!Shiva.COM!world!gsk
References: <2A778A16.26787@noiro.acs.uci.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!decwrl!bu.edu!Shiva.COM!world!gsk
From: gsk@world.std.com (Geoffrey S Knauth)
Newsgroups: comp.sys.next.programmer
Subject: Re: usleep and efficiency
Message-ID: <Bs75rr.Ivp@world.std.com>
Date: 30 Jul 92 10:14:14 GMT
References: <2A778A16.26787@noiro.acs.uci.edu>
Organization: The World Public Access UNIX, Brookline, MA
Lines: 11