lua-users home
lua-l archive

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


On 1/21/11 8:34 PM, Axel Kittenberger wrote:
On Fri, Jan 21, 2011 at 8:10 PM, Alexander Gladysh <agladysh@gmail.com> wrote:
On Fri, Jan 21, 2011 at 22:08, Steve Litt <slitt@troubleshooters.com> wrote:
On Friday 21 January 2011 03:48:02 Axel Kittenberger wrote:

Is table lookup really more expensive than passing in as an arg and passing
back as a return? Ugh!
Try LJ2, you will think about these implementation details no longer. :-)
Strange I didnt see that email :-/

Lua Tables are hashtables. Putting and getting stuff from a hashtable
is of course slower than from a local variable (that is either on
stack or even a register)

Possibly a fresh opportunity to optimize the table implementation qua single shot key cache for such cases?

Mostly less visibly and intended, cases like Steve's primearray[...] use could be quite frequent in the wild. Not as misunderstanding, but per program flow. Could it pay off to look at the first-last-found-key first, always?

Henning