lua-users home
lua-l archive

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


I was wondering how much performance overhead is there when using metatable __index?
Meaning how much slower it is to use metatables + __index?
 
I plan to use this
 
function Account:new (o)
      o = o or {}
      setmetatable(o, self)
      self.__index = self
      return o
end
or this
 
function Account:new (o)
    o = o or {}
    Table.Copy(o, self) -- copies self to o
    return o
end