4 ms·
Since you pointed out that Lua strings are immutable you're aware of what I'm about to say, but just to make it explicit: The efficiency argument is a common o
by hisham_hm 12y ago
Since you pointed out that Lua strings are immutable you're aware of what I'm about to say, but just to make it explicit:
The efficiency argument is a common one for symbols in general, but in Lua it doesn't really hold because string comparison has constant cost (ie, it's a simple pointer test, since strings are immutable).
- to3m 12y agoImmutable and interned! (This may or may not be an issue, but it still offended me somewhat, since you're getting all of the compile-time cost at runtime, combined with none of the expressiveness. Not a tradeoff that impresses me, personally, even if the speed is fine - but it takes all sorts.)