Posts: 426
Threads: 39
Joined: May 2006
Dean,
Do we pay a performance penalty for using global variable versus local variables?
Does one put more overhead on the IV than the other?
Thanks.
Posts: 40,483
Threads: 491
Joined: Aug 2002
Not really. It's just that locals don't accumulate and therefore don't run the risk of two things accidentally using them for different things and interfering with each other. Globals should only be used when you need to keep information around across actions. That's not for overhead reasons, just for good design reasons.
Otherwise use locals and they get thrown away once the action is complete. That also of course insures that they don't already exist each time an action is run, so you also can't accidentally screw yourself up by picking up previously set values when you didn't want to.
Dean Roddey
Explorans limites defectum
Posts: 426
Threads: 39
Joined: May 2006
Thanks. I was just concerned that global variable might put a higher load on the system but it sounds like that's not the case.