Open naturallymitchell opened 2 years ago
@naturallymitchell Thanks for doing these tests.
Micro benchmarks are notorious, but it doesn't sound quite right that the Lua 5.3.5 interpreter (I'm assuming you weren't using LuaJit?) is within even 20-30% the speed for aot compiled Dart code. Trying your test code with Dart AOT and Lua 5.3.6 on Ubuntu 22.04, I got comparatively same results as you posted. So I suspected that maybe the startup time is swamping the actual results.
Trying your test code with higher iteration counts I get very different comparative results for Dart AOT vs Lua 5.3.1:
with 30:
time lib/main.exe
832040
real 0m0.013s
user 0m0.009s
sys 0m0.005s
time lua bench.lua
832040
real 0m0.068s
user 0m0.068s
sys 0m0.000s
with 40:
time lib/main.exe
102334155
real 0m0.588s
user 0m0.580s
sys 0m0.008s
time lua bench.lua
102334155
real 0m8.050s
user 0m8.046s
sys 0m0.004s
with 50:
time lib/main.exe
12586269025
real 1m12.875s
user 1m12.870s
sys 0m0.004s
time lua bench.lua
12586269025
real 16m15.980s
user 16m15.896s
sys 0m0.016s
I'll try to make some time to run the microbenchmark for the higher iterations with LuaDardo and the native Dart binding soon too.
Just to get a basic sense of this library's performance, I ran 4 tests using fibonacci (code included).
Lua 5.3.5
LuaDardo with same Lua code (AOT compiled)
Dart-native code (AOT compiled)
LuaDardo w/ bindings to native Dart code (AOT compiled)
2.
3.
4.
1.
2.
3.
4.