luaとluajitのmacシミュレータでの実行比較

433 ワード

簡単にdemoを書いてcococos 2 dx macシミュレータに基づいてテストします
テストコードはすべてコードです
print("lua start compute1")
local a = 1
for i=1,100000000,1 do
    a = 1
end
print("lua start compute2")

luaのログは次のとおりです.
[2.0224] lua start compute1
[4.2614] lua start compute2
luajitログは次のとおりです.
[2.6538] lua start compute1
[2.7019] lua start compute2
このdemo luajitは0.05秒、luaは2.2秒実行されていることがわかります.