|
On Mar 31, 2007, at 5:42 AM, Graham Wakefield wrote:
The number of index operations on tables does not go down when the metatable is the same table as the method table, so I don't see the big performance gain (apart from slightly lower processor cache use maybe?). Lua is still doing 'getmetatable(udata).__index["method"]'. As there is only one instance of each the difference in memory use is insubstantial, and you'd be unable to gain access to __gc if you set __metatable. I performed a little test, and sharing the method table and metatable was actually 2.5% slower, I don't know why. Gé -- Gé Weijers |