|
On 26/10/12 11:58, spir wrote:
Is it worth in Lua, at start of a func or before a loop, to "localise" table fields? As in:
For innermost loops, and if your code will spend some time running, it does make a difference. Remember that the extra time you spend typing those localization is only amortized if you code does a lot of loops.
As time passes i've started to obsess less and less about that stuff. When i write the code for the first time i only localize if it makes the code clearer, not out of performance reasons. After the code works and does what it is supposed to do, i perhaps would pour over the code looking for bottlenecks.
Jorge