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