home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / lang / fortran / 3312 < prev    next >
Encoding:
Internet Message Format  |  1992-08-31  |  1.5 KB

  1. Path: sparky!uunet!gatech!darwin.sura.net!wupost!waikato.ac.nz!aukuni.ac.nz!ecmtwhk
  2. Newsgroups: comp.lang.fortran
  3. Subject: Re: Scientists as Programmers (was Re: Smal
  4. Message-ID: <1992Aug31.233148.471@ccu1.aukuni.ac.nz>
  5. From: ecmtwhk@ccu1.aukuni.ac.nz (Thomas Koenig)
  6. Date: Mon, 31 Aug 1992 23:31:48 GMT
  7. References: <BttB9z.IAy@mentor.cc.purdue.edu> <1992Aug30.232409.15262@nrao.edu> 
  8.  <1992Aug31.163405.2169@newshost.lanl.gov> <1992Aug31.164354.3518@newshost.lanl.gov>
  9. Organization: University of Auckland, New Zealand.
  10. Lines: 24
  11.  
  12. jlg@cochiti.lanl.gov (Jim Giles) writes:
  13.  
  14. [about subroutine calls]
  15.  
  16. >The *real* cost is in
  17. >register scheduling (including canonical interface protocols) around
  18. >the call, as well as a break in optimization basic-blocks (and many `live'
  19. >values must be assumed `killed' by the call).  Herman Rubin was right
  20. >to begin with, procedure calls are, and will remain for a long time, 
  21. >among the most expensive of operations.  Calls would be expensive even if
  22. >the specific branch instructions used to implement and return from them
  23. >were *free*.
  24.  
  25. Depends on the architecture you are using. On a MIPS, for example, the
  26. ucode optimizer does global register optimization across function calls,
  27. so a subroutine call is relatively cheap.
  28.  
  29. On more conventional systems, try and avoid using global variables in
  30. loops with subroutine calls. This should keep the optimizer happy (and
  31. your code clearer, too).
  32. -- 
  33. Thomas Koenig, ecmtwhk@ccu1.aukuni.ac.nz, ib09@rz.uni-karlsruhe.de
  34. The joy of engineering is to find a straight line on a double logarithmic
  35. diagram.
  36.