home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / programm / 2086 < prev    next >
Encoding:
Internet Message Format  |  1992-07-23  |  2.2 KB

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