[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: why benchmarks need salt
- From: Roberto Ierusalimschy <roberto@...>
- Date: Mon, 20 Jul 2015 13:00:47 -0300
I was doing some quick-and-dirty benchmarks about 'table.move'. The
file 'temp' is here:
--------------------------------------------------------------
local a = {}
local lim = 10000
local rep = 1000
for i = 1, lim do a[i] = i end
local t = os.clock()
for i = 1, rep do table.move(a, 1, lim, 2) end
print(os.clock() - t)
--------------------------------------------------------------
Now, see how the times change with the name of the executable:
roberto@arraial:~/prj/lua$ lua temp
0.91
roberto@arraial:~/prj/lua$ lua temp
0.91
roberto@arraial:~/prj/lua$ mv lua lua1
roberto@arraial:~/prj/lua$ lua1 temp
0.57
roberto@arraial:~/prj/lua$ lua1 temp
0.57
roberto@arraial:~/prj/lua$ mv lua1 sol
roberto@arraial:~/prj/lua$ sol temp
0.91
roberto@arraial:~/prj/lua$ sol temp
0.91
roberto@arraial:~/prj/lua$ mv sol sol1
roberto@arraial:~/prj/lua$ sol1 temp
0.57
roberto@arraial:~/prj/lua$ sol1 temp
0.58
-- Roberto