Lua VS Dart benchmarks

Current benchmark data was generated on Sun Jan 29 2023, full log can be found HERE

CONTRIBUTIONS are WELCOME!

[x86_64][2 cores] Intel(R) Xeon(R) Platinum 8370C CPU @ 2.80GHz (Model 106)

* -m in a file name stands for multi-threading or multi-processing

* -i in a file name stands for direct intrinsics usage. (Usage of simd intrinsics via libraries is not counted)

* -ffi in a file name stands for non-stdlib FFI usage

* (You may find time < time(user) + time(sys) for some non-parallelized programs, the overhead is from GC or JIT compiler, which are allowed to take advantage of multi-cores as that's more close to real-world scenarios.)

binarytrees

Input: 18

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
dart 1.dart 1005ms 0.9ms 87.6MB 970ms 37ms dart/exe 2.19.0
lua 1.lua timeout 0.0ms 119.6MB 4940ms 43ms lua 5.4.4
lua 1.lua timeout 0.0ms 180.4MB 4920ms 60ms luajit 2.1.0-beta3

Input: 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
dart 1.dart 103ms 2.9ms 47.2MB 70ms 20ms dart/exe 2.19.0
lua 1.lua 409ms 5.4ms 25.0MB 387ms 3ms luajit 2.1.0-beta3
lua 1.lua 1054ms 8.6ms 17.4MB 1037ms 3ms lua 5.4.4

helloworld

Input: QwQ

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
lua 1.lua 1.9ms 0.5ms 2.5MB 0ms 0ms luajit 2.1.0-beta3
lua 1.lua 2.4ms 0.9ms 1.5MB 0ms 0ms lua 5.4.4
dart 1.dart 7.3ms 0.7ms 13.8MB 0ms 0ms dart/exe 2.19.0

merkletrees

Input: 17

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
dart 1.dart 497ms 2.6ms 71.0MB 467ms 33ms dart/exe 2.19.0
lua 1.lua timeout 0.0ms 159.2MB 4923ms 57ms lua 5.4.4
lua 1.lua timeout 0.0ms 180.9MB 4927ms 53ms luajit 2.1.0-beta3

Input: 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
dart 1.dart 124ms 0.5ms 48.7MB 103ms 7ms dart/exe 2.19.0
lua 1.lua 1630ms 18ms 35.4MB 1603ms 10ms luajit 2.1.0-beta3
lua 1.lua 2785ms 38ms 41.6MB 2753ms 10ms lua 5.4.4

nbody

Input: 5000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
dart 3.dart 530ms 5.0ms 13.5MB 517ms 0ms dart/exe 2.19.0
lua 4.lua 1104ms 10ms 1.5MB 1093ms 0ms luajit 2.1.0-beta3
lua 4.lua timeout 0.0ms 1.5MB 4990ms 0ms lua 5.4.4

Input: 500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
dart 3.dart 62ms 1.3ms 14.2MB 50ms 0ms dart/exe 2.19.0
lua 4.lua 114ms 1.8ms 2.3MB 100ms 0ms luajit 2.1.0-beta3
lua 4.lua 1204ms 27ms 1.4MB 1190ms 0ms lua 5.4.4

spectral-norm

Input: 8000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
dart 1.dart timeout 0.0ms 13.7MB 4980ms 0ms dart/exe 2.19.0
lua 1.lua timeout 0.0ms 2.3MB 4990ms 0ms lua 5.4.4
lua 1.lua timeout 0.0ms 2.6MB 4990ms 0ms luajit 2.1.0-beta3

Input: 4000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
dart 1.dart 1293ms 1.0ms 13.9MB 1273ms 0ms dart/exe 2.19.0
lua 1.lua 1561ms 0.9ms 2.5MB 1550ms 0ms luajit 2.1.0-beta3
lua 1.lua timeout 0.0ms 2.1MB 4990ms 0ms lua 5.4.4

Input: 2000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
dart 1.dart 333ms 2.8ms 13.5MB 317ms 0ms dart/exe 2.19.0
lua 1.lua 391ms 0.7ms 1.5MB 380ms 0ms luajit 2.1.0-beta3
lua 1.lua timeout 0.0ms 1.4MB 4990ms 0ms lua 5.4.4

coro-prime-sieve

Input: 4000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
lua 1.lua 555ms 1.7ms 5.1MB 540ms 0ms luajit 2.1.0-beta3
dart 1.dart timeout 0.0ms 24.9MB 4927ms 50ms dart/exe 2.19.0

Input: 1000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
lua 1.lua 39ms 1.0ms 3.1MB 30ms 0ms luajit 2.1.0-beta3
dart 1.dart 546ms 7.7ms 18.2MB 503ms 23ms dart/exe 2.19.0