Swift VS Javascript benchmarks

Current benchmark data was generated on Wed Sep 28 2022, 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 3385ms 0.2ms 5.1MB 3373ms 0ms swift 5.7.0

Input: 10

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
swift 1.swift 285ms 0.9ms 5.1MB 280ms 0ms swift 5.7.0

fasta

Input: 2500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
swift 3-m.swift 365ms 3.0ms 21.1MB 660ms 0ms swift 5.7.0

Input: 250000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
swift 3.swift 57ms 0.8ms 14.8MB 60ms 0ms swift 5.7.0

helloworld

Input: QwQ

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
swift 1.swift 2.1ms 0.7ms 2.4MB 0ms 0ms swift 5.7.0
javascript 1.js 15ms 0.4ms 50.6MB 0ms 0ms bun 0.1.13
javascript 1.js 55ms 0.4ms 41.9MB 38ms 4ms node 18.9.1

knucleotide

Input: 2500000_in

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
swift 2-m.swift 2319ms 337ms 52.2MB 3893ms 27ms swift 5.7.0

Input: 250000_in

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
swift 2-m.swift 361ms 12ms 33.6MB 610ms 10ms swift 5.7.0

nbody

Input: 5000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
swift 7.swift 433ms 13ms 5.1MB 427ms 0ms swift 5.7.0
javascript 6.js 626ms 6.2ms 46.9MB 610ms 7ms node 18.9.1
javascript 6.js 1062ms 1.4ms 63.3MB 1050ms 7ms bun 0.1.13

Input: 500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
swift 7.swift 45ms 0.3ms 5.1MB 37ms 0ms swift 5.7.0
javascript 6.js 122ms 1.0ms 48.6MB 107ms 3ms node 18.9.1
javascript 6.js 125ms 1.6ms 65.2MB 113ms 7ms bun 0.1.13

pidigits

Input: 8000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
javascript 3.js timeout 0.0ms 0.0MB 0ms 0ms node 18.9.1
swift 1.swift timeout 0.0ms 0.0MB 0ms 0ms swift 5.7.0

Input: 4000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
javascript 3.js 1608ms 4.0ms 62.8MB 1583ms 20ms node 18.9.1
swift 1.swift 2636ms 19ms 6.7MB 2607ms 3ms swift 5.7.0