Path: utzoo!mnetor!uunet!husc6!cmcl2!nrl-cmf!ames!necntc!dandelion!ulowell!hawk!hvo From: hvo@hawk.ulowell.edu (Huy D. Vo) Newsgroups: comp.os.vms Subject: Re: 2 C questions Message-ID: <5981@swan.ulowell.edu> Date: 5 Apr 88 04:48:26 GMT References: <12387779883.20.STEINBERGER@KL.SRI.COM> Sender: news@swan.ulowell.edu Reply-To: hvo@hawk.ulowell.edu (Huy D. Vo) Organization: University of Lowell, CS Dept. Lines: 19 In article <12387779883.20.STEINBERGER@KL.SRI.COM> STEINBERGER@KL.SRI.COM (Richard Steinberger) writes: >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? This requires one instruction to raise the stack pointer to point beyond the C local variables. Now my point: most of the time, C functions want values, whereas Fortran subroutines invariably expect addresses. If fetching an address is faster than fetching a value, then Fortran wins. Any microcode experts out there? How about some benchmarks? Huy D. Vo hvo@hawk.ulowell.edu