[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: string.len(str) vs str:len()
- From: Coda Highland <chighland@...>
- Date: Thu, 7 Aug 2014 11:19:59 -0700
On Thu, Aug 7, 2014 at 11:14 AM, Mason Mackaman <masondeanm@aol.com> wrote:
> Also doesn’t there have to be some emphasis on the locality (can I say that?) of getmetatable(‘’).__index, otherwise it wouldn’t be any faster?
No, there doesn't. The table lookup (__index) is neither local nor
global, it's a table lookup. And the implicit metatable access doesn't
have ANY overhead at all -- the metatable is just a field on the
object's internal structure. Obviously calling getmetatable() yourself
has the overhead of looking up the getmetatable() function and the
function call itself.
/s/ Adam
- References:
- string.len(str) vs str:len(), Mason Mackaman
- Re: string.len(str) vs str:len(), Thiago L.
- Re: string.len(str) vs str:len(), Mason Mackaman
- Re: string.len(str) vs str:len(), Thiago L.
- Re: string.len(str) vs str:len(), Mason Mackaman
- Re: string.len(str) vs str:len(), Coda Highland
- Re: string.len(str) vs str:len(), Thiago L.
- Re: string.len(str) vs str:len(), Mason Mackaman
- Re: string.len(str) vs str:len(), Coda Highland
- Re: string.len(str) vs str:len(), Mason Mackaman
- Re: string.len(str) vs str:len(), Mason Mackaman
- Re: string.len(str) vs str:len(), Mason Mackaman
- Re: string.len(str) vs str:len(), Elias Barrionovo
- Re: string.len(str) vs str:len(), Mason Mackaman