Swift VS Dart benchmarks

Current benchmark data was generated on Wed Feb 08 2023, full log can be found HERE

CONTRIBUTIONS are WELCOME!

[x86_64][2 cores] Intel(R) Xeon(R) Platinum 8171M 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 3536ms 37ms 2.4MB 3527ms 0ms swift 5.7.3
dart 2.dart timeout 0.0ms 12.5MB 4977ms 0ms dart/exe 2.19.2
dart 2.dart timeout 0.0ms 13.8MB 4980ms 0ms dart/exe 3.0.0-187.0.dev

Input: 10

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
swift 1.swift 293ms 2.8ms 5.2MB 283ms 0ms swift 5.7.3
dart 2.dart 417ms 1.6ms 11.8MB 403ms 0ms dart/exe 2.19.2
dart 2.dart 461ms 12ms 11.3MB 443ms 0ms dart/exe 3.0.0-187.0.dev

fasta

Input: 2500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
swift 3.swift 474ms 12ms 21.1MB 630ms 10ms swift 5.7.3
dart 1.dart 587ms 19ms 15.9MB 570ms 0ms dart/exe 3.0.0-187.0.dev
dart 1.dart 626ms 2.3ms 16.8MB 607ms 0ms dart/exe 2.19.2

Input: 250000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
dart 1.dart 74ms 3.5ms 15.0MB 57ms 0ms dart/exe 3.0.0-187.0.dev
swift 3.swift 74ms 2.7ms 14.7MB 60ms 0ms swift 5.7.3
dart 1.dart 76ms 1.9ms 16.4MB 63ms 0ms dart/exe 2.19.2

helloworld

Input: QwQ

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
swift 1.swift 4.4ms 0.2ms 0.0MB 0ms 0ms swift 5.7.3
dart 1.dart 8.4ms 0.3ms 12.2MB 0ms 0ms dart/exe 3.0.0-187.0.dev
dart 1.dart 611ms 547ms 13.4MB 0ms 0ms dart/exe 2.19.2

knucleotide

Input: 2500000_in

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
swift 2-m.swift 2402ms 35ms 44.4MB 4443ms 47ms swift 5.7.3
dart 3-m.dart 3627ms 75ms 283.4MB 6467ms 117ms dart/exe 3.0.0-187.0.dev
dart 3-m.dart 3661ms 88ms 255.4MB 6563ms 120ms dart/exe 2.19.2

Input: 250000_in

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
swift 2-m.swift 496ms 97ms 41.4MB 723ms 27ms swift 5.7.3
dart 3-m.dart 553ms 21ms 199.6MB 880ms 87ms dart/exe 2.19.2
dart 3-m.dart 559ms 21ms 200.4MB 877ms 87ms dart/exe 3.0.0-187.0.dev

nbody

Input: 5000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
swift 7.swift 565ms 41ms 5.1MB 553ms 0ms swift 5.7.3
dart 3.dart 736ms 6.8ms 13.9MB 717ms 0ms dart/exe 3.0.0-187.0.dev
dart 3.dart 742ms 4.1ms 13.8MB 720ms 0ms dart/exe 2.19.2

Input: 500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
swift 7.swift 58ms 2.1ms 5.1MB 47ms 0ms swift 5.7.3
dart 3.dart 85ms 0.6ms 12.1MB 70ms 0ms dart/exe 2.19.2
dart 3.dart 86ms 2.4ms 11.5MB 70ms 0ms dart/exe 3.0.0-187.0.dev

pidigits

Input: 8000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
dart 2.dart 1892ms 32ms 19.5MB 1820ms 53ms dart/exe 3.0.0-187.0.dev
dart 2.dart 2080ms 11ms 21.7MB 2023ms 43ms dart/exe 2.19.2
swift 1.swift timeout 0.0ms 6.3MB 4967ms 10ms swift 5.7.3

Input: 4000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
dart 2.dart 471ms 4.6ms 22.0MB 420ms 33ms dart/exe 3.0.0-187.0.dev
dart 2.dart 534ms 23ms 20.2MB 483ms 33ms dart/exe 2.19.2
swift 1.swift 3180ms 62ms 6.2MB 3163ms 0ms swift 5.7.3