Swift VS OCaml benchmarks

Current benchmark data was generated on Sat Jan 28 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 3393ms 14ms 2.4MB 3377ms 0ms swift 5.7.3
ocaml 2.ml 3975ms 4.3ms 2.8MB 3963ms 0ms ocaml 5.0.0

Input: 10

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
swift 1.swift 285ms 0.5ms 5.3MB 273ms 0ms swift 5.7.3
ocaml 2.ml 330ms 1.2ms 2.9MB 320ms 0ms ocaml 5.0.0

fasta

Input: 2500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
swift 3-m.swift 390ms 3.2ms 20.9MB 687ms 10ms swift 5.7.3
ocaml 6.ml 421ms 0.7ms 22.7MB 403ms 0ms ocaml 5.0.0

Input: 250000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
ocaml 6.ml 46ms 0.5ms 4.9MB 33ms 0ms ocaml 5.0.0
swift 3.swift 58ms 0.9ms 14.6MB 53ms 3ms swift 5.7.3

helloworld

Input: QwQ

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
swift 1.swift 1.8ms 0.1ms 2.3MB 0ms 0ms swift 5.7.3
ocaml 1.ml 2.5ms 0.7ms 2.9MB 0ms 0ms ocaml 5.0.0

knucleotide

Input: 2500000_in

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
swift 2-m.swift 2299ms 268ms 42.5MB 4253ms 23ms 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 381ms 27ms 33.6MB 643ms 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 426ms 0.2ms 5.1MB 410ms 0ms swift 5.7.3
ocaml 1.ml 468ms 0.1ms 3.0MB 460ms 0ms ocaml 5.0.0

Input: 500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
swift 7.swift 45ms 0.5ms 5.1MB 37ms 0ms swift 5.7.3
ocaml 1.ml 50ms 1.2ms 2.9MB 40ms 0ms ocaml 5.0.0

pidigits

Input: 8000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
swift 1.swift timeout 0.0ms 6.4MB 4953ms 13ms swift 5.7.3

Input: 4000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
swift 1.swift 2571ms 3.4ms 6.2MB 2553ms 3ms swift 5.7.3