home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / lang / misc / 3538 < prev    next >
Encoding:
Text File  |  1992-11-08  |  2.9 KB  |  59 lines

  1. Newsgroups: comp.lang.misc
  2. Path: sparky!uunet!ukma!usenet.ins.cwru.edu!agate!stanford.edu!leland.Stanford.EDU!dhinds
  3. From: dhinds@leland.Stanford.EDU (David Hinds)
  4. Subject: Re: Hardware Support for Numeric Algorithms
  5. Message-ID: <1992Nov6.230030.16637@leland.Stanford.EDU>
  6. Sender: news@leland.Stanford.EDU (Mr News)
  7. Organization: DSG, Stanford University, CA 94305, USA
  8. References: <1992Oct29.153514.22927@yrloc.ipsa.reuter.COM> <1992Nov5.202412.7266@linus.mitre.org> <1de9ckINNfj7@life.ai.mit.edu>
  9. Date: Fri, 6 Nov 92 23:00:30 GMT
  10. Lines: 47
  11.  
  12. In article <1de9ckINNfj7@life.ai.mit.edu> tmb@ai.mit.edu writes:
  13. >
  14. >I do write and use long-running programs (weeks, months) that use
  15. >multiple workstations extensively in my work.
  16. >
  17. >For such programs, I find that correctness and maintainability are of
  18. >paramount importance.  Efficiency, on the other hand, is of much
  19. >less importance.  If I run my program once for 9 weeks, I'm going to be
  20. >much better off than if I speed it up by 30% but have to run it twice
  21. >(for a total of 12 weeks) because I introduced some error.
  22.  
  23. Sorry, I think correctness/maintainability and efficiency are usually
  24. orthogonal and one can usually have both.  I don't think paying
  25. attention to efficiency has anything to do with whether or not it is a
  26. good idea to "test" a program by letting it run for six weeks.  And
  27. I'd expect that the speedup from "no attention to efficiency" to
  28. "reasonable attention to efficiency" is often much more than 30%.  A
  29. little profiling and tuning can go a long way.  And I usually run my
  30. programs a lot more than twice.
  31.  
  32. Also, I find that rewriting code to improve its efficiency sometimes
  33. helps me turn up bugs, if doing the "same thing" a different way gives
  34. me a different result.  Careful profiling can also give useful data
  35. for debugging.
  36.  
  37. When I write code, I'll try to get it running correctly first, and then
  38. worry about efficiency, but I do eventually worry about it.  The programs
  39. I'm developing take up to a few days on a small parallel supercomputer or
  40. cluster of fast workstations.  And most of the code I write is reused a
  41. lot, so tuning it impacts everything I do.  I would not start a long run
  42. with new code without testing it first.
  43.  
  44. >I think the idea that scientific programmers have to squeeze every last
  45. >cycle out of their machines is a myth passed on from generation to
  46. >generation and is out of touch with the modern economic realities of
  47. >programming. The only people who have to squeeze every last cycle out
  48. >of their programs are real-time programmers and software/hardware
  49. >vendors who are concerned with looking good on benchmarks.
  50.  
  51. That is an odd myth; I'd say that scientific programmers write a lot
  52. of bad "efficient" code mainly because they write bad code, period.  I
  53. know enough of them that are plenty eager to get as many cycles as
  54. they can, but wouldn't spend a half-hour profiling their garbage code
  55. to see why it takes so long in the first place.
  56.  
  57.         - David Hinds
  58.           dhinds@allegro.stanford.edu
  59.