[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Lua 5.0 to 5.1 performance regression?
- From: Rici Lake <lua@...>
- Date: Sun, 24 Sep 2006 20:26:51 -0500
On 24-Sep-06, at 7:33 PM, Glenn Maynard wrote:
iFreeListRef = ref;
if(ref == iMaxReference)
--iMaxReference;
I think that should be:
if (ref == iMaxReference)
--iMaxReference;
else
iFreeListRef = ref;
Otherwise, you'll give out the same references twice.
You may find it faster to nil out the reference table entry, and keep
the free list in your own private datastructure; it's possible that
your compiler is not generating good code for converting between
integer and floating point. (In general, you should use lua_pushinteger
with lua 5.1, I think.) You could also try storing the freelist indices
coerced to (void *) and wrapped as lightuserdata.