Dart VS Swift benchmarks

Current benchmark data was generated on Tue Dec 31 2024, full log can be found HERE

CONTRIBUTIONS are WELCOME!

[x86_64][4 cores] AMD EPYC 7763 64-Core Processor (Model 1)

* -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.)

binarytrees

Input: 18

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
dart 1.dart 673ms 4.6ms 80.7MB 640ms 33ms dart/exe 3.6.0
swift 1.swift 2431ms 13ms 54.0MB 2407ms 7ms swift 6.0.3

Input: 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
dart 1.dart 75ms 3.2ms 42.8MB 53ms 10ms dart/exe 3.6.0
swift 1.swift 222ms 2.8ms 11.8MB 210ms 0ms swift 6.0.3

coro-prime-sieve

Input: 4000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
dart 1.dart 4761ms 115ms 19.3MB 5287ms 80ms dart/exe 3.6.0

Input: 1000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
dart 1.dart 317ms 3.7ms 10.0MB 323ms 3ms dart/exe 3.6.0

edigits

Input: 250001

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
dart 1.dart 3368ms 13ms 18.0MB 3330ms 33ms dart/exe 3.6.0

Input: 100000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
dart 1.dart 555ms 3.6ms 10.4MB 530ms 13ms dart/exe 3.6.0

fannkuch-redux

Input: 11

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
swift 1.swift 2350ms 22ms 5.6MB 2337ms 0ms swift 6.0.3
dart 2.dart 2626ms 13ms 6.1MB 2617ms 0ms dart/exe 3.6.0

Input: 10

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
swift 1.swift 199ms 1.9ms 5.6MB 190ms 0ms swift 6.0.3
dart 2.dart 213ms 4.3ms 6.1MB 200ms 0ms dart/exe 3.6.0

fasta

Input: 2500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
swift 3-m.swift 135ms 5.7ms 24.6MB 367ms 7ms swift 6.0.3
dart 1.dart 342ms 3.8ms 8.9MB 327ms 0ms dart/exe 3.6.0

Input: 250000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
swift 3.swift 35ms 0.4ms 18.3MB 33ms 0ms swift 6.0.3
dart 1.dart 40ms 1.2ms 8.9MB 30ms 0ms dart/exe 3.6.0

helloworld

Input: QwQ

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
swift 1.swift 2.4ms 0.2ms 6.0MB 0ms 0ms swift 6.0.3
dart 1.dart 3.6ms 0.1ms 6.3MB 0ms 0ms dart/exe 3.6.0

http-server

Input: 3000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
dart 2-m.dart 1547ms 267ms 115.4MB 1087ms 1520ms dart/exe 3.6.0
dart 1.dart 4162ms 113ms 113.2MB 1103ms 1500ms dart/exe 3.6.0

Input: 500

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
dart 2-m.dart 291ms 6.1ms 50.3MB 177ms 267ms dart/exe 3.6.0
dart 1.dart 2087ms 499ms 49.9MB 163ms 243ms dart/exe 3.6.0

json-serde

Input: sample 5000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
dart 1.dart 158ms 3.1ms 53.9MB 130ms 17ms dart/exe 3.6.0

Input: canada 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
dart 1.dart 1394ms 26ms 300.2MB 1440ms 107ms dart/exe 3.6.0

knucleotide

Input: 2500000_in

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
dart 3-m.dart 1000ms 12ms 278.4MB 2963ms 110ms dart/exe 3.6.0
swift 2-m.swift 1324ms 22ms 74.6MB 4820ms 30ms swift 6.0.3

Input: 250000_in

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
dart 3-m.dart 193ms 3.6ms 195.1MB 460ms 47ms dart/exe 3.6.0
swift 2-m.swift 250ms 3.1ms 63.8MB 653ms 30ms swift 6.0.3

lru

Input: 1000 1000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
dart 2.dart 160ms 5.4ms 9.3MB 153ms 0ms dart/exe 3.6.0
dart 1.dart 491ms 0.3ms 9.1MB 477ms 0ms dart/exe 3.6.0

Input: 1000 3000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
dart 2.dart 449ms 2.2ms 9.1MB 440ms 0ms dart/exe 3.6.0
dart 1.dart 1444ms 9.7ms 9.1MB 1433ms 3ms dart/exe 3.6.0

Input: 100 500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
dart 2.dart 71ms 0.4ms 9.0MB 57ms 0ms dart/exe 3.6.0
dart 1.dart 107ms 0.5ms 9.1MB 97ms 0ms dart/exe 3.6.0

merkletrees

Input: 17

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
dart 1.dart 307ms 2.2ms 63.6MB 277ms 27ms dart/exe 3.6.0

Input: 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
dart 1.dart 80ms 0.2ms 43.6MB 60ms 10ms dart/exe 3.6.0

nbody

Input: 5000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
swift 7.swift 329ms 4.6ms 9.6MB 317ms 0ms swift 6.0.3
dart 3.dart 395ms 1.7ms 6.1MB 383ms 0ms dart/exe 3.6.0

Input: 500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
swift 7.swift 37ms 0.6ms 9.8MB 23ms 0ms swift 6.0.3
dart 3.dart 43ms 0.6ms 6.3MB 30ms 0ms dart/exe 3.6.0

pidigits

Input: 8000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
dart 2.dart 1183ms 10ms 14.5MB 1157ms 30ms dart/exe 3.6.0
swift 1.swift timeout 0.0ms 7.4MB 4913ms 70ms swift 6.0.3

Input: 4000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
dart 2.dart 299ms 6.9ms 14.6MB 277ms 13ms dart/exe 3.6.0
swift 1.swift 1766ms 11ms 6.9MB 1753ms 0ms swift 6.0.3

regex-redux

Input: 2500000_in

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
dart 1.dart timeout 0.0ms 204.3MB 4947ms 67ms dart/exe 3.6.0

Input: 250000_in

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
dart 1.dart 522ms 16ms 48.4MB 497ms 13ms dart/exe 3.6.0

spectral-norm

Input: 8000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
dart 1.dart 3542ms 12ms 6.1MB 3533ms 0ms dart/exe 3.6.0
dart 2.dart 4104ms 5.2ms 6.3MB 4093ms 0ms dart/exe 3.6.0

Input: 4000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
dart 1.dart 895ms 6.1ms 6.3MB 883ms 0ms dart/exe 3.6.0
dart 2.dart 1041ms 1.0ms 6.1MB 1027ms 0ms dart/exe 3.6.0

Input: 2000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
dart 1.dart 231ms 2.3ms 6.3MB 220ms 0ms dart/exe 3.6.0
dart 2.dart 266ms 0.3ms 6.1MB 253ms 0ms dart/exe 3.6.0