|
On 07/01/2012 14.02, Jeff Smith wrote:
I put some debug code in to try and understand what is going on, it would seem that the lua_close() function triggers the destruction of over 4000 objects, (so is taking approx 2mS per object to free)
What I'm about to say may have nothing to do with your problem, but just in case...
Are the 2ms per object just the deallocation time, or is there something else involved? If it's just the deallocation time, it sounds quite high even for a "fairly puny CPU". Maybe you're using an allocator that is inefficent in deallocations when there are lots of small objects on the heap? (should this turn out to be the case, I'd suggest a constant-time allocator like tlsf).
-- Enrico