lua-users home
lua-l archive

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




On 20/07/15 01:00 PM, Roberto Ierusalimschy wrote:
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

So you can boost the speed of Lua scripts by renaming the Lua binary?

--
Disclaimer: these emails are public and can be accessed from <TODO: get a non-DHCP IP and put it here>. If you do not agree with this, DO NOT REPLY.