[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: LuaJIT performance query
- From: "Alex Davies" <alex.mania@...>
- Date: Sun, 15 Jun 2008 21:23:58 +0800
Hey,
LuaJit has no way of knowing that you didn't run this code before the chunk
you gave:
setmetatable(_G, { __newindex = function(tab, key, val)
print "setting global "..key
rawset(tab, key, val)
end })
Or similar. It is possible for later Jiters to optimize the value to a local
register and check that the global table still has no metamethods before
each access, but jit 1.x definitely does not do this. And it would only
encourage bad programming practices if it did imo. Use locals :)
- Alex