lua-users home
lua-l archive

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


Sorry, I made a mistake in last post. I forgot add -O2 in lua origin version.

Now test again in my windows 10 / mingw64.

CPU i5-2500k @ 3.60 GHz

            origin version         modified version
test 1     3.276s                    1.278s
test 2     3.376s                    1.413s

 
---- test 1 ---
function f(a)
end

local t = os.clock()

for i=1, 10000000 do
f { x=1, y=2 }
end

print(os.clock() -t)
-------------
Origin version of lua 5.3.2 : 4.977s
Modified version of lua 5.3.2: 1.278s

 

---- test 2 ---
function f(a)
   a.x = 3
end

local t = os.clock()

for i=1, 10000000 do
f { x=1, y=2 }
end

print(os.clock() -t)
-------------
Origin version of lua 5.3.2 : 5.234s
Modified version of lua 5.3.2: 1.413s