[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Could metatables easily be faster?
- From: Flyer31 Test <flyer31@...>
- Date: Fri, 20 May 2022 09:10:41 +0200
So you mean, this would work already for current Lua 5.4? Without
change of Lua source code?
Sorry for too many questions... I do not really understand how you
would use "fixed userdata" to instruct Lua to "overlay customized
operators" (this is what metatables essentially do, as I see it. BTW
from my point of view metatables ARE a very smart and powerful way to
keep Lua very flexible and adaptable... of course as larger the
metatable gets, and the more often such meta functions need to be
tested / invoked in a Lua program, there will come up "wishful
thinking" for time optimisation... just optimisation in
programmingALWAYS is dangerous, as it easily can restrict / kill
future flexibility).
On Fri, May 20, 2022 at 2:11 AM 云风 <cloudwu@gmail.com> wrote:
>
> I think there is a better way to make metatables faster . Just using a fixed structure userdata as the metatable.
>
> We can put the common metamethods into uservalue slots.