Lua高速化プロジェクト開発状況など(1)
AO benchが動いたので
% grep 'model name' /proc/cpuinfo model name : AMD Athlon(tm)64 X2 Dual Core Processor 4600+ model name : AMD Athlon(tm)64 X2 Dual Core Processor 4600+ % uname -a Linux rambai.cs.uec.ac.jp 2.6.26-2-amd64 #1 SMP Fri Aug 14 02:17:16 UTC 2009 x86_64 GNU/Linux % ./src/lua-original test/ao.lua --- aobench --- init scene render start save ppm time to render end 193 total time 193 --- done --- % ./src/lua-stackalloc-dev test/ao.lua --- aobench --- init scene render start save ppm time to render end 138 total time 138 --- done ---
138*100/193 = 71.50... → 約30%の高速化
GC時間の計測
% ./src/lua-gctime-original test/ao.lua --- aobench --- init scene render start save ppm time to render end 191 total time 191 --- done --- ## execution: 191.114170 s, gc: 29.057515 s % ./src/lua-gctime-stackalloc-dev test/ao.lua --- aobench --- init scene render start save ppm time to render end 142 total time 142 --- done --- ## execution: 142.623048 s, gc: 0.000066 s
細かいことはいいじゃないですか
% cat | ./src/lua-stackalloc-dev
local t = {10, 20}
local u = {t}
u[1][1] = u[1][1] + 100
print("t[1]", t[1])
print("u[1][1]", u[1][1])
v = {t}
v[1][1] = v[1][1] + 100
print("t[1]", t[1])
print("u[1][1]", u[1][1])
print("v[1][1]", v[1][1])
t[1] 110
u[1][1] 110
t[1] 110
u[1][1] 110
v[1][1] 210仕様です。未実装。よくないよ。次か次の次ぐらいで実装する。
開発場所
コードとかは基本的に全てgithubにて公開。Linux/gccとWindows/VCでビルドできるはず。
http://github.com/hogelog/lua