Swift VS Typescript 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
typescript 1.ts 2032ms 2.8ms 38.7MB 1927ms 113ms deno 1.30.0

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
typescript 1.ts 264ms 46ms 39.0MB 230ms 17ms deno 1.30.0

helloworld

Input: QwQ

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
swift 1.swift 2.2ms 1.1ms 2.3MB 0ms 0ms swift 5.7.3
typescript 1.ts 26ms 1.3ms 31.8MB 14ms 2ms deno 1.30.0

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
typescript 6.ts 653ms 21ms 37.8MB 637ms 7ms deno 1.30.0

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
typescript 6.ts 96ms 1.8ms 37.9MB 83ms 0ms deno 1.30.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.7MB 4957ms 23ms swift 5.7.3
typescript 3.ts timeout 0.0ms 79.4MB 4950ms 40ms deno 1.30.0

Input: 4000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
typescript 3.ts 1493ms 5.5ms 58.9MB 1433ms 67ms deno 1.30.0
swift 1.swift 2577ms 13ms 6.5MB 2557ms 0ms swift 5.7.3