From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,99ab4bb580fc34cd X-Google-Attributes: gid103376,public From: dewar@cs.nyu.edu (Robert Dewar) Subject: Re: Q: access to subprogram Date: 1996/07/06 Message-ID: #1/1 X-Deja-AN: 164137509 references: <4rb9dp$qe6@news1.delphi.com> <4re2ng$t7u@wdl1.wdl.loral.com> organization: Courant Institute of Mathematical Sciences newsgroups: comp.lang.ada Date: 1996-07-06T00:00:00+00:00 List-Id: Bob Duff said "sure, but I think that perhaps static links are faster. I'm quite *sure* of two things: it doesn't make much difference, since most code isn't very deeply nested anyway, and if there *is* a difference, it's not a big difference." If there is no nesting, then neither static links nor displays have any overhead at all. If there is nesting, then static links pay a price for calling any routine other than an outer level library routine. If there is nesting, then displays pay a price for calling any routine that contains a nested routine, but there is no price for calling any routine (at library level or nested) if it contains no nested routines. It seems to be evident that the great majority of calls are to routines that do NOT contain nested routines. Consider in particular the case of a big procedure q that contains many tested procedures q1 .. q100. Now for static links, calls to any of q1 .. q100 incur an overhead, but the call to q does not (assuming q is global level). For displays, calls to any of q1 .. q100 (assuming there is no further level of nesting) incur no overhead, only the call to q incurs an overhead. It seems clear to me from these considerations that displays will be faster than static links for most typical programs.