[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: (not) handling new programming idioms with grace
- From: Hisham <h@...>
- Date: Tue, 14 Aug 2018 20:55:21 -0300
On 21 July 2018 at 09:27, Roberto Ierusalimschy <roberto@inf.puc-rio.br> wrote:
>> If the emergency collection became the standard behavior of io.open I
>> suspect that "beware that opening a file in Lua may trigger a full GC"
>> would become one of those dreaded folk-wisdom performance tips.
>
> In a generational collector, any allocation can trigger a major
> collection. io.open allocates memory (to create the stream handle),
> so this dreaded folk-wisdom performance tip is bound to happen anyway.
> (Or maybe not?)
Is a major collection in the generational GC comparable to a full
collection as triggered by collectgarbage()? I thought it would be
more like a regular collection from the incremental GC (with the minor
collections being faster than those).
-- Hisham