lua-users home
lua-l archive

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


> > I remain curious. Has this been tested and found too slow before?
> 
> Yes. I can't provide a reference right now but relying on
> collectgarbage() to force release of non-memory resources via __gc at
> the necessary times has proven to be unusable for my workload pattern.
> It incurred a significant performance hit due to unnecessary memory
> traversal.

I am still curious whether that could work as I suggested, calling
__gc as a kind of emergency collection, only when some resource
allocation fails. For instance, in the case of file handles in Linux,
that would mean ~1 full GC for every 1000 streams created, not
one GC per stream.

-- Roberto