Lua VS D benchmarks

Current benchmark data was generated on Wed Feb 08 2023, full log can be found HERE

CONTRIBUTIONS are WELCOME!

[x86_64][2 cores] Intel(R) Xeon(R) Platinum 8171M CPU @ 2.60GHz (Model 85)

* -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
d 1.d 3904ms 94ms 75.1MB 4177ms 23ms ldc2 1.30.0
d 1.d timeout 0.0ms 125.0MB 5580ms 40ms dmd 2.102.0
lua 1.lua timeout 0.0ms 119.5MB 4903ms 70ms lua 5.4.4
lua 1.lua timeout 0.0ms 174.6MB 4897ms 83ms luajit 2.1.0-beta3

Input: 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
d 1.d 356ms 15ms 15.1MB 343ms 0ms ldc2 1.30.0
d 1.d 480ms 7.3ms 27.2MB 497ms 7ms dmd 2.102.0
lua 1.lua 584ms 53ms 24.6MB 553ms 10ms luajit 2.1.0-beta3
lua 1.lua 1408ms 8.5ms 17.4MB 1387ms 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 2.4ms 0.8ms 2.2MB 0ms 0ms luajit 2.1.0-beta3
lua 1.lua 2.4ms 1.0ms 1.4MB 0ms 0ms lua 5.4.4
d 1.d 2.8ms 1.0ms 4.4MB 0ms 0ms dmd 2.102.0
d 1.d 3.3ms 0.9ms 2.9MB 0ms 0ms ldc2 1.30.0

merkletrees

Input: 17

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
d 1.d 1818ms 21ms 74.8MB 1883ms 23ms ldc2 1.30.0
d 1.d 3152ms 10ms 153.9MB 3520ms 57ms dmd 2.102.0
lua 1.lua timeout 0.0ms 159.1MB 4913ms 67ms lua 5.4.4
lua 1.lua timeout 0.0ms 180.9MB 4870ms 107ms luajit 2.1.0-beta3

Input: 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
d 1.d 355ms 8.2ms 38.9MB 330ms 13ms ldc2 1.30.0
d 1.d 660ms 15ms 40.5MB 707ms 10ms dmd 2.102.0
lua 1.lua 2162ms 57ms 38.5MB 2130ms 13ms luajit 2.1.0-beta3
lua 1.lua 3623ms 55ms 41.6MB 3593ms 13ms lua 5.4.4

nbody

Input: 5000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
d 1.d 542ms 7.3ms 1.5MB 527ms 0ms ldc2 1.30.0
d 2.d 577ms 7.9ms 1.5MB 563ms 0ms ldc2 1.30.0
lua 4.lua 1337ms 28ms 1.5MB 1320ms 0ms luajit 2.1.0-beta3
d 1.d 1466ms 20ms 2.6MB 1453ms 0ms dmd 2.102.0
d 2.d 2593ms 6.6ms 2.7MB 2580ms 0ms dmd 2.102.0
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
d 1.d 57ms 0.4ms 1.5MB 50ms 0ms ldc2 1.30.0
d 2.d 60ms 0.3ms 1.5MB 47ms 0ms ldc2 1.30.0
lua 4.lua 138ms 1.4ms 1.5MB 123ms 0ms luajit 2.1.0-beta3
d 1.d 155ms 4.8ms 2.6MB 140ms 0ms dmd 2.102.0
d 2.d 264ms 4.0ms 2.6MB 257ms 0ms dmd 2.102.0
lua 4.lua 1886ms 102ms 1.4MB 1873ms 0ms lua 5.4.4

spectral-norm

Input: 8000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
d 1.d 3326ms 2880ms 5.1MB 4983ms 0ms dmd 2.102.0
d 1.d 4357ms 8.9ms 3.7MB 4343ms 0ms ldc2 1.30.0
lua 1.lua timeout 0.0ms 2.2MB 4977ms 3ms lua 5.4.4
lua 1.lua timeout 0.0ms 2.5MB 4987ms 0ms luajit 2.1.0-beta3

Input: 4000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
d 1.d 1091ms 0.8ms 3.5MB 1080ms 0ms ldc2 1.30.0
d 1.d 1256ms 3.0ms 5.1MB 1243ms 0ms dmd 2.102.0
lua 1.lua 1702ms 29ms 2.5MB 1687ms 0ms luajit 2.1.0-beta3
lua 1.lua timeout 0.0ms 2.3MB 4987ms 0ms lua 5.4.4

Input: 2000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
d 1.d 278ms 0.5ms 3.0MB 267ms 0ms ldc2 1.30.0
d 1.d 318ms 1.4ms 4.4MB 310ms 0ms dmd 2.102.0
lua 1.lua 434ms 2.7ms 1.5MB 423ms 0ms luajit 2.1.0-beta3
lua 1.lua timeout 0.0ms 1.5MB 4990ms 0ms lua 5.4.4