View Single Post
05/13/14, 07:29 AM   #14
Wobin
 
Wobin's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 78
Generally, the point is you don't need to run the garbage collector manually because it will be cleaned up as part of the normal routine of the Lua system. Forcing a GC cycle means you affect the entire system as it sets aside cycles to do a complete sweep, something it already has scheduled for in the near future.

Essentially, unless you are creating thousands of tables and niling them all out in one fell swoop, the gains from forcing a GC pale against the hit it gives to performance overall. It's unnecessary optimisation, your discarded tables will be cleaned up with the next GC cycle along with everything else.

And given that this whole situation is a once off application (ie, you're clearing the tables once and not doing it again), manual GC is unnecessary.
  Reply With Quote