Dart VS C++ 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

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

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
cpp 1-im.cpp 383ms 1.6ms 4.7MB 1463ms 0ms g++ 11.4.0
cpp 1-im.cpp 396ms 27ms 8.0MB 1473ms 3ms clang++ 14.0.0-1ubuntu1.1
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
cpp 1-im.cpp 40ms 0.7ms 7.9MB 120ms 0ms clang++ 14.0.0-1ubuntu1.1
cpp 1-im.cpp 40ms 0.7ms 4.5MB 133ms 0ms g++ 11.4.0
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
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
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
cpp 1.cpp 1.0ms 0.1ms 1.4MB 0ms 0ms g++ 11.4.0
cpp 1.cpp 1.8ms 1.0ms 2.1MB 0ms 0ms clang++ 14.0.0-1ubuntu1.1
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

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

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
cpp 0-i.cpp 158ms 1.3ms 1.5MB 150ms 0ms g++ 11.4.0
cpp 0-i.cpp 168ms 2.5ms 2.3MB 160ms 0ms clang++ 14.0.0-1ubuntu1.1
cpp 1.cpp 294ms 0.7ms 1.8MB 280ms 0ms g++ 11.4.0
cpp 1.cpp 298ms 3.2ms 2.3MB 287ms 0ms clang++ 14.0.0-1ubuntu1.1
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
cpp 0-i.cpp 17ms 0.2ms 1.5MB 10ms 0ms g++ 11.4.0
cpp 0-i.cpp 18ms 0.1ms 2.3MB 10ms 0ms clang++ 14.0.0-1ubuntu1.1
cpp 1.cpp 32ms 0.4ms 1.8MB 20ms 0ms g++ 11.4.0
cpp 1.cpp 33ms 0.7ms 2.3MB 23ms 0ms clang++ 14.0.0-1ubuntu1.1
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

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

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
cpp 8-m.cpp 458ms 3.4ms 4.2MB 1780ms 0ms g++ 11.4.0
cpp 8-m.cpp 459ms 22ms 7.3MB 1757ms 0ms clang++ 14.0.0-1ubuntu1.1
cpp 6-im.cpp 876ms 7.8ms 7.4MB 3420ms 0ms clang++ 14.0.0-1ubuntu1.1
cpp 6-im.cpp 885ms 20ms 4.2MB 3437ms 3ms g++ 11.4.0
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
cpp 8-m.cpp 118ms 1.8ms 7.4MB 433ms 0ms clang++ 14.0.0-1ubuntu1.1
cpp 8-m.cpp 126ms 5.2ms 4.1MB 463ms 0ms g++ 11.4.0
cpp 6-im.cpp 225ms 2.6ms 7.4MB 847ms 0ms clang++ 14.0.0-1ubuntu1.1
cpp 6-im.cpp 226ms 2.7ms 4.1MB 857ms 0ms g++ 11.4.0
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
cpp 8-m.cpp 37ms 0.9ms 4.0MB 117ms 0ms g++ 11.4.0
cpp 8-m.cpp 42ms 11ms 7.4MB 117ms 0ms clang++ 14.0.0-1ubuntu1.1
cpp 6-im.cpp 64ms 1.6ms 7.3MB 210ms 0ms clang++ 14.0.0-1ubuntu1.1
cpp 6-im.cpp 64ms 0.1ms 4.0MB 227ms 0ms g++ 11.4.0
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