I see a lot of widgets define local aliases for all the spring commands and constants that them use.
Did anyone ever benchmark properly if that makes anything faster?
Spring is using LUA JIT, aka "just in time compiler" (edit: or, at very least, compiles into VM), and i suppose compiler would look up all symbols only on first use anyway (no dictionary searches on consequent symbol uses), so that you gain precisely nothing from defining local names; only get slightly slower loading time and more obfuscation.
Speed advantage from defining local aliases seems really dubious and unlikely; and if it does give any advantage, i'd rather fix JIT compiler than obfuscate all the lua code i write.
"Localizing" functions and constants.
Moderator: Moderators
Re: "Localizing" functions and constants.
viewtopic.php?f=21&t=15748
Lua scripts are not JIT'ed.
Lua scripts are not JIT'ed.
Re: "Localizing" functions and constants.
What was the problem using luajit in spring?
luajit features
looks good... is there any unsupported important lua features now?
luajit features
looks good... is there any unsupported important lua features now?
- very_bad_soldier
- Posts: 1397
- Joined: 20 Feb 2007, 01:10
Re: "Localizing" functions and constants.
I find this quite interesting: http://trac.caspring.org/wiki/LuaPerformance