|
> On Nov 23, 2017, at 4:45 AM, Rodrigo Azevedo <rodrigoams@gmail.com> wrote:
>
> 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"))) > The "generational" GC from github [3] perform 40% faster than the standard GC.
> 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:
>
>
>
> Someone versed in GC magics could discuss about the changes made from 5.2 to github version of GC?
>
I’m confused by this. First, you say that gtihub is 40% faster, but quote no times?
Second, what are your expectations of the GC in Lua? Pretty much all you have done is noticed that the GC has not run during the second “for” loop. So what? Why did you expect it to?
—Tim
Attachment:
dados.pdf
Description: Adobe PDF document
collectgarbage("generational") N = 1.0e4 for A = 1,100,25 do collectgarbage("collect") C = {} for i=1,A*N do C[i] = i end local mem1 = collectgarbage("count") for B = 1,100 do collectgarbage("collect") for i=1,B*N*10 do local a = {1,2,3,4} end local mem2 = collectgarbage("count") print(string.format("%d %d %.1f %.1f",A,B,mem1,mem2)) end io.write("\n\n") end