Not to dig up an old discussion, but...
>http://luajit.org/ext_ffi_tutorial.html
>This is less important with LuaJIT, since the JIT compiler optimizes hash-table lookups a lot and is even able to hoist most of them out of the inner loops. It can't eliminate all of them, though, and it saves some typing for often-used functions. So there's still a place for this, even with LuaJIT.
LuaJIT is generally able to optimize hash table lookups, so in reality there shouldn't be a serious performance impact from calling functions that are inside a local (not global) table. It's still considered best practice to stick with locals as much as possible though.
On Wednesday, October 8, 2014 8:21:32 AM UTC-4, Lionel Duboeuf wrote:
Le 08/10/2014 11:59, Vladislav Manchev a écrit :
> This idiom serves both isolation and performance purposes in this case
> as far as I see when looking at code.
>
> It does not allow you to directly change module's internal workings
> from the outside and also speeds up performance.
>
> You can refer to the module definition page [1] in the lua-users wiki
> for more information and examples, it should be helpful to clear
> things up.
>
>
> [1]: http://lua-users.org/wiki/ModuleDefinition
>
>
ok,i see better now.
Thanks for all
regards
lionel