home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!pipex!unipalm!uknet!acorn!armltd!dseal
- From: dseal@armltd.co.uk (David Seal)
- Newsgroups: comp.programming
- Subject: Re: finding 1st one in integer
- Message-ID: <4582@armltd.uucp>
- Date: 23 Jul 92 11:43:10 GMT
- References: <1992Jul22.120735@is.morgan.com>
- Sender: dseal@armltd.uucp
- Distribution: comp
- Organization: A.R.M. Ltd, Swaffham Bulbeck, Cambs, UK
- Lines: 39
-
- In article <1992Jul22.120735@is.morgan.com> berlin@is.morgan.com (Alexander
- Berlin) writes:
-
- >In article <1992Jul22.152827.14267@cs.cornell.edu>, ressler@cs.cornell.edu (Gene Ressler) writes:
- >
- >|> benchmark code (chris torek?), this runs about 400% faster than the 37 element
- >
- >Just a side note: it's impossible to have code that runs 400% faster. Twice
- >as fast means 50% faster. 100% faster means in NO TIME.
- >400% slower makes sense, 400% faster doesn't.
- >4 times faster means 75% faster.
-
- I think you're confusing "N% faster" with "takes N% less time".
-
- The standard way of working out a percentage is to take the ratio (old
- value)/(new value), subtract 1 and multiply by 100. IMHO, most people would
- take "100% faster" to mean that the new speed is 100% greater than the old
- speed. This means that you work out the percentage speedup by calculating
- the ratio (new speed)/(old speed), or equivalently (old time to run
- program)/(new time to run program), subtracting 1 and multiplying by 100.
- This makes 50% faster mean 1.5 times as fast, 100% faster mean twice as
- fast, 400% faster mean 5 times as fast.
-
- Where you have to be careful about percentages is with reciprocals. For
- instance, "speed" and "time to run program" are reciprocals of each other:
- if you double the time to run, its speed is half what it was before. The
- tricky point is that an N% increase in a quantity does *not* mean an N%
- decrease in a reciprocal quantity. (Aside: it's a close approximation when N
- is small, but is only exactly true when N is zero.)
-
- For instance, if I double the speed of a program, its speed is twice as much
- - i.e. 100% greater - and its time to run is half as much - i.e. 50%
- smaller. Or put more briefly, it's 100% faster and takes 50% less time.
- "100% faster" and "takes 100% less time" do not mean the same thing.
-
- David Seal
- dseal@armltd.co.uk
-
- All opinions are mine only...
-