lua-users home
lua-l archive

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


  I hate to suggest something that might seem like a giant step backwards,
especially since I love the tag method mechanism, but... <grin>

  It might be nice if it were possible to permanently designate a table as
"raw" if it were known that no tag methods would be used on it.  (in fact,
attempting to do so probably should generate an error)  This purely for
performance reasons, to avoid the overhead of the full tag method checking,
so that all access to the table would immediately and implicitly go through
the raw versions.   In other words, this would essentially flag the VM to
do a raw get/set instead of having to explicity call rawgettable() or
rawsettable() from Lua code (which are still a performance hit).  Mainly to
benefit the case of large "dumb" global data accessed more-or-less
exclusively via Lua code, not C.  A utility routine to make this change to
an existing table [ex: makeraw(t)] would seem to be an acceptable way of
implementing such functionality without adding a keyword -- if it seemed
like something worth doing in the first place.  :)

  Cheers,

  Dave