Path: utzoo!mnetor!uunet!husc6!mailrus!ames!amdahl!nsc!voder!cullsj!jayz From: jayz@cullsj.UUCP (Jay Zorzy) Newsgroups: comp.os.vms Subject: Re: 2 C questions Message-ID: <281@cullsj.UUCP> Date: 5 Apr 88 16:57:42 GMT References: <12387779883.20.STEINBERGER@KL.SRI.COM> Organization: Cullinet Software, San Jose, CA Lines: 19 From article <12387779883.20.STEINBERGER@KL.SRI.COM>, by STEINBERGER@KL.SRI.COM (Richard Steinberger): > C vs. Fortran speed: Since C variables are automatic (i.e., dynamic) by > default and Fortran variables are static, is it fair to conclude that in > general, a routine in C having the same number of local variables as > a "roughly identical" Fortarn routine will take a bit longer because > the OS must allocate (and deallocate) space for the local variables? > If the C local variables are made static, does this possible performance > advantage disappear? It depends on the size of the variables. Dynamic variables are allocated from the stack, so if you've got huge arrays, VMS will obviously have more work to do to allocate them on the stack. Another point to consider, is that static variables are allocated during image activation in R/W, copy- on-reference (CRF) sections. Depending on the frequency these sections are accessed, you may have paging activity to consider. Jay Zorzy Cullinet Software San Jose, CA