New issue report by maorlando:
I noticed a lot of the code uses standard lua library calls (like
string.format, table.insert, etc.). WoW provides a slew of global aliases
to these functions which would both be more efficient and save a bit of
source size.
See the readme file for my wow-like lua distro for a complete list
(http://sf.net/projects/lua511wow)
Issue attributes:
Status: New
Owner: ----
Labels: Type-Defect Priority-Medium
--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings
Comment #1 by Tekkub:
I never quite understood how global aliases helped in any way, someone want to
enlighten me? I know LOCAL aliases help speed up things a tad.
Comment #2 by jnwhiteh:
string.format takes a global lookup, then a table index lookup.
strformat takes a global lookup
local strformat = string.format at the top of the file would be the best, and by far
makes the most sense to me. I'll do this after I've applied my outstanding patches.
Issue attribute updates:
Owner: jnwhiteh
Comment #3 by Tekkub:
That was exactly what I was thinking :) If I was worried about lookup speed I would
skip the global alias and just create me a local alias *grin*
Comment #4 by maorlando:
Then of course there's the middle option (at least for strings) of doing:
someString:format(blah, blah, blah)