View Single Post
01-10-18, 10:39 PM   #45
myrroddin
A Pyroguard Emberseer
 
myrroddin's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 1,240
This is a huge oversimplification, and is not 100% accurate, but it gets the point across:
Lua Code:
  1. local some_boy = "Harry"
  2. local some_girl = "Sally"
In Lua, since it is single threaded, it executes line 1, then line 2. A multithreaded language would execute both lines simultaneously, because at the bare minimum, multiple threads by nature start with two threads or executions per compute cycle.

If a language supported up to the new 36 threads from AMD and Intel, you could send 36 commands at the same time.

As to your question about cons, the two biggest about upvaluing are:
  • Initial startup time is a bit slower as your code has to look up the globals then store them in memory to variables. Unless you upvalue a crazy amount of globals, you won't notice this slow down on modern computers.
  • Your app, program, script, addon, whatever consumes more RAM because it is storing more things in memory. Again, with modern computers this isn't a big deal, but a player with 8GB of RAM while playing WoW doesn't have overhead to spare if he/she installs a hundred or so addons.
Not listed is a very minor con, in that unless you are looking up a global often, ie// during OnUpdate or rapid event firings, you don't gain much, if anything.
  Reply With Quote