lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]



On Wed, Jun 26, 2019 at 9:58 AM Coda Highland <chighland@gmail.com> wrote:
Might, actually. It adds overhead to every assignment. With <toclose> or whatever we end up calling it you gain the ability to implement it yourself in the contexts where it matters without slowing down the Lua core.

This overhead would be substantial, because for every assignment you'd have to check whether the value being copied (number/object reference/...) needs to have a reference count updated, adding at least one conditional jump. The same thing is true when a function exits, you can't just drop the stack frame, but you have to inspect every value. Similarly, a lot of lua_xxx routines called from C would have to add reference count checks.

The impact on performance would not be minor.


--