lua-users home
lua-l archive

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


This message is an update about a problem from last year [1] on the performance of the following simple script

-- collectgarbage("generational")
N = 2.0e7
C = {}
for i=1,N do C[i] = i end
print(string.format("%.1f",collectgarbage("count")))
for i=1,10*N do
    local a = {1,2,3,4}
end
print(string.format("%.1f",collectgarbage("count")))

motivated by the recent statement of Roberto [2] about the "generational" GC of Lua 5.4.

Results for the script above:

lua-5.2 standard GC

524312.0
892302.1

lua-5.2 "generational" GC [3]

524310.7
892044.1 -- NO IMPROVEMENT

lua-5.3 standard GC

524313.0
892224.2

lua-github standard GC

524309.9
940081.9 -- THIS IS NOT GOOD, BUT...

lua-github "generational" GC

524309.6
525110.9 -- OBSERVE THIS MAGIC NUMBER!

The "generational" GC from github [3] perform 40% faster than the standard GC.

Someone versed in GC magics could discuss about the changes made from 5.2 to github version of GC?

Thank you!

[1] http://lua-users.org/lists/lua-l/2016-05/msg00376.html
[2] http://lua-users.org/lists/lua-l/2017-10/msg00113.html
[3] collectgarbage("generational")

--
Rodrigo Azevedo Moreira da Silva