|
-
Jan 11th, 2007, 09:07 AM
#1
Thread Starter
Addicted Member
static variable vs Global variable
hi guys, i just want to know if static local variable consume less memory than global variable
Thanks
-
Jan 11th, 2007, 09:14 AM
#2
Re: static variable vs Global variable
A quote:
18. Use Module-Level Variables Instead Of "Static" Local Variables [0114]
While static variables are useful for storing values between multiple executions of a procedure, they are slower than local variables. By storing the same value in a module-level variable your procedure will execute faster. Note, however, that you will need to make sure that only one procedure is allowed to change the module-level variable. The tradeoff here is that code will be less readable and harder to maintain.
from Performance Tuning Tips
-
Jan 11th, 2007, 09:39 AM
#3
Thread Starter
Addicted Member
Re: static variable vs Global variable
speed doesn't matter for me
my question is which one cosume less memory
-
Jan 11th, 2007, 09:56 AM
#4
Fanatic Member
Re: static variable vs Global variable
I'm not sure but if it's faster, that means it takes less memory to run
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|