Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
LVars vs GVars
#1
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.
Reply
#2
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
Reply
#3
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.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  LVars and Floating Point pjgregory 1 1,293 07-25-2016, 09:46 AM
Last Post: Dean Roddey
  Are GVars persistent even after power is off? ghurty 4 1,963 01-10-2015, 03:46 PM
Last Post: ghurty
  Passing Cookies in Gvars? pjgregory 1 1,385 10-20-2011, 07:55 AM
Last Post: pjgregory
  question on if logic and GVars greymatter 2 1,487 06-16-2011, 04:22 PM
Last Post: greymatter
  LVars with popups jchurley 1 1,563 09-04-2009, 04:47 AM
Last Post: Mark Stega
  LVar/GVars in widgets froop 5 1,895 10-31-2008, 11:09 AM
Last Post: Dean Roddey
  Dynamic Widgets using GVars jmwhooper 2 1,371 11-25-2007, 03:11 PM
Last Post: jmwhooper
  GetText and LVars in Action bph 2 1,659 01-03-2007, 03:48 PM
Last Post: Dean Roddey

Forum Jump:


Users browsing this thread: 1 Guest(s)