lua-users home
lua-l archive

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


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