Swift VS Javascript benchmarks

Current benchmark data was generated on Mon Feb 06 2023, full log can be found HERE

CONTRIBUTIONS are WELCOME!

[x86_64][2 cores] Intel(R) Xeon(R) Platinum 8272CL 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.)

fannkuch-redux

Input: 11

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
swift 1.swift 2924ms 4.7ms 2.4MB 2910ms 0ms swift 5.7.3

Input: 10

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
swift 1.swift 245ms 1.3ms 2.4MB 230ms 0ms swift 5.7.3

fasta

Input: 2500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
swift 3.swift 405ms 28ms 22.7MB 537ms 10ms swift 5.7.3

Input: 250000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
swift 3.swift 65ms 1.8ms 14.7MB 40ms 7ms swift 5.7.3

helloworld

Input: QwQ

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
swift 1.swift 3.4ms 0.1ms 0.0MB 0ms 0ms swift 5.7.3
javascript 1.js 17ms 0.7ms 50.3MB 0ms 10ms bun 0.5.5
javascript 1.js 44ms 1.3ms 42.7MB 28ms 4ms node 19.6.0

knucleotide

Input: 2500000_in

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
swift 2-m.swift 2227ms 12ms 42.1MB 4180ms 30ms 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 393ms 32ms 33.6MB 630ms 17ms swift 5.7.3

nbody

Input: 5000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
swift 7.swift 453ms 6.5ms 5.2MB 443ms 0ms swift 5.7.3
javascript 6.js 690ms 0.8ms 47.8MB 673ms 10ms node 19.6.0
javascript 6.js 1031ms 11ms 70.5MB 1017ms 13ms bun 0.5.5

Input: 500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
swift 7.swift 49ms 2.8ms 5.2MB 40ms 0ms swift 5.7.3
javascript 6.js 116ms 1.6ms 48.3MB 103ms 3ms node 19.6.0
javascript 6.js 125ms 1.1ms 67.1MB 110ms 13ms bun 0.5.5

pidigits

Input: 8000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
javascript 3.js timeout 0.0ms 79.3MB 4980ms 27ms node 19.6.0
swift 1.swift timeout 0.0ms 6.7MB 4970ms 10ms swift 5.7.3

Input: 4000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
javascript 3.js 1595ms 5.1ms 62.9MB 1583ms 20ms node 19.6.0
swift 1.swift 2616ms 0.1ms 6.3MB 2600ms 3ms swift 5.7.3