lua-users home
lua-l archive

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


Does anyone else think it would be nice to simply have a byte tag stored with each userdata? Couldn't be quicker to check, and it'd have the added benefit of allowing custom metatables per userdata object. (Only useful in a few cases, but still).

- Alex

----- Original Message ----- From: "Taj Khattra"

On Thu, Feb 28, 2008 at 7:57 AM, Chris <coderight@gmail.com> wrote:
 fine but luaL_checkudata adds a significant amount of overhead when
 making heavy use of calls that need to check userdata types (which is
 very important when creating "safe" APIs).

did you compare the performance of storing the metatable in the C function
environment instead of the registry?

i seem to recall mike pall posting some performance numbers comparing
the two approaches, but google is failing me at the moment.