[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: (not) handling new programming idioms with grace
- From: Roberto Ierusalimschy <roberto@...>
- Date: Fri, 20 Jul 2018 13:33:56 -0300
> > 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
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.