Swift VS Lua 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.)

fannkuch-redux

Input: 11

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
swift 1.swift 3382ms 1.8ms 2.5MB 3370ms 0ms swift 5.7.3

Input: 10

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
swift 1.swift 284ms 0.9ms 2.4MB 270ms 0ms swift 5.7.3

fasta

Input: 2500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
swift 3-m.swift 380ms 10ms 20.9MB 690ms 3ms swift 5.7.3

Input: 250000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
swift 3.swift 56ms 0.5ms 14.6MB 60ms 0ms swift 5.7.3

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
swift 1.swift 2.2ms 1.1ms 2.3MB 0ms 0ms swift 5.7.3
lua 1.lua 2.4ms 0.9ms 1.5MB 0ms 0ms lua 5.4.4

knucleotide

Input: 2500000_in

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
swift 2-m.swift 2299ms 439ms 52.3MB 3857ms 27ms swift 5.7.3

Input: 250000_in

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
swift 2-m.swift 353ms 6.9ms 31.4MB 600ms 13ms swift 5.7.3

nbody

Input: 5000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
swift 7.swift 431ms 9.3ms 5.1MB 417ms 0ms swift 5.7.3
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
swift 7.swift 48ms 2.9ms 5.1MB 40ms 0ms swift 5.7.3
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

pidigits

Input: 8000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
swift 1.swift timeout 0.0ms 6.7MB 4957ms 23ms swift 5.7.3

Input: 4000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
swift 1.swift 2577ms 13ms 6.5MB 2557ms 0ms swift 5.7.3