Tuesday, 6 August 2013

Is there any performance value in creating local copies of lua functions?

Is there any performance value in creating local copies of lua functions?

Is there any value in creating local copies of common lua functions like
print(), pairs() or ipairs()?
Example:
local _print = print
local _pairs = pairs
local _ipairs = ipairs
for i, v in _ipairs(someTable) do
_print(v)
end
I've seen some lua written using this and am wondering if there are any
benefits (performance or otherwise) to doing this?
Cheers.

No comments:

Post a Comment