lua和luajit在cocos2dx mac模拟器的简单测试
简单写了个demo 基于cocos2dx 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秒