[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: When is multiple assignment good style?
- From: Javier Guerra Giraldez <javier@...>
- Date: Thu, 16 Mar 2017 17:19:35 +0000
On 16 March 2017 at 16:49, Chris Jones <email@example.com> 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
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