Global variables are slower?
Anjul Srivastava
anjul.srivastava@sanchez.com
Fri Feb 11 14:16:00 GMT 2000
Hello
folks,
ÃÂ
Somebody told me
that accessing a global variable requires an extra instruction, and thus, global
variables are slower than local variables.
ÃÂ
Is this true for gcc
generated code? I'm surprised if it is because I understood from my knowledge of
C that there was no performance difference between local and global
variables.
ÃÂ
Can it be optimized
out, at least for repeated accesses, if it is true?
ÃÂ
Thanks a
lot,
Anjul.
More information about the Gcc
mailing list