From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.5-pre1 (2020-06-20) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-1.9 required=3.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.5-pre1 Date: 18 Sep 92 22:50:08 GMT From: eachus@mitre-bedford.arpa (Robert I. Eachus) Subject: Re: Using Global Variables Message-ID: List-Id: In article <16864C1E7.M19481@mwvm.mitre.org> M19481@mwvm.mitre.org writes: > The main reason I've heard used to justify the use of global variables is > performance of a real-time system. The argument goes that the overhead of > parameter passing is just too high to meet the performance requirements on > the target machine (which cannot be changed), hence global variables. Now > you may argue that the target machine should have been chosen more wisely, > or the choice delayed until after the software was totally developed so as > to be able to pick the right size machine -- but I imagine that that's what > Mr. Goffin had in mind when he used the term "real world." Next time some know-nothing tells you this, throw some benchmarks at him. In most modern architectures with most good compilers references to local variables and parameters are much faster than global memory references. The only time it is faster to use a global instead of a parameter is when the parameter is referenced less than once per call... -- Robert I. Eachus with STANDARD_DISCLAIMER; use STANDARD_DISCLAIMER; function MESSAGE (TEXT: in CLEVER_IDEAS) return BETTER_IDEAS is...