lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

On 16 March 2017 at 16:49, Chris Jones <> wrote:
> This always seems to be the argument, but is it actually valid?
> I just benchmarked table.insert vs a local alias, in a loop, with one
> million iterations, and the difference was 0.01s

sometimes it _is_ valid.  In SnabbSwitch, once I found a single local
variable missing had a 6% impact in the number of packets processed
per second.

of course, that was a "true" local variable, not a module-level
upvalue, but it saved one table query on a second-level loop, so it
did matter.