Chapel VS C benchmarks

Current benchmark data was generated on Wed Sep 28 2022, 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.)

binarytrees

Input: 18

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
chapel 4.chpl 2319ms 53ms 64.2MB 2293ms 17ms chpl 1.27.0
chapel 3.chpl 2420ms 6.9ms 46.5MB 2393ms 17ms chpl 1.27.0

Input: 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
chapel 4.chpl 220ms 0.7ms 32.1MB 203ms 7ms chpl 1.27.0
chapel 3.chpl 223ms 0.5ms 16.1MB 213ms 0ms chpl 1.27.0

coro-prime-sieve

Input: 4000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
chapel 1-m.chpl 3883ms 83ms 87.5MB 7530ms 53ms chpl 1.27.0

Input: 1000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
chapel 1-m.chpl 269ms 1.9ms 36.2MB 490ms 7ms chpl 1.27.0

edigits

Input: 250001

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
chapel 1.chpl 97ms 0.8ms 36.1MB 90ms 0ms chpl 1.27.0

Input: 100000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
chapel 1.chpl 46ms 0.1ms 34.1MB 40ms 0ms chpl 1.27.0

fasta

Input: 2500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
chapel 5-m.chpl 148ms 2.1ms 32.0MB 253ms 0ms chpl 1.27.0

Input: 250000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
chapel 5.chpl 33ms 1.1ms 32.0MB 37ms 0ms chpl 1.27.0

helloworld

Input: QwQ

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
c 1.c 1.5ms 0.1ms 1.1MB 0ms 0ms clang 11.0.0
c 1.c 1.6ms 0.2ms 1.0MB 0ms 0ms gcc 12.2.0
c 1.c 1.8ms 0.7ms 0.6MB 0ms 0ms zigcc 0.10.0-dev.4192+c75e8f361
chapel 1.chpl 19ms 2.4ms 32.4MB 4ms 6ms chpl 1.27.0

knucleotide

Input: 2500000_in

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
c 1-m.c 247ms 5.3ms 23.5MB 407ms 17ms gcc 12.2.0
c 1-m.c 529ms 44ms 20.3MB 830ms 17ms clang 11.0.0
chapel 3-m.chpl 960ms 3.0ms 86.8MB 1777ms 17ms chpl 1.27.0

Input: 250000_in

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
c 1.c 33ms 0.8ms 12.8MB 50ms 0ms gcc 12.2.0
c 1-m.c 63ms 1.8ms 9.4MB 100ms 0ms clang 11.0.0
chapel 3-m.chpl 165ms 1.2ms 76.8MB 263ms 17ms chpl 1.27.0

nbody

Input: 5000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
c 8-i.c 311ms 2.7ms 0.6MB 300ms 0ms zigcc 0.10.0-dev.4192+c75e8f361
c 5.c 320ms 0.3ms 0.9MB 307ms 0ms gcc 12.2.0
c 5.c 328ms 0.6ms 0.6MB 320ms 0ms zigcc 0.10.0-dev.4192+c75e8f361
c 2.c 338ms 0.8ms 0.6MB 330ms 0ms zigcc 0.10.0-dev.4192+c75e8f361
c 8-i.c 347ms 1.6ms 1.1MB 333ms 0ms clang 11.0.0
chapel 2.chpl 361ms 0.2ms 32.4MB 353ms 0ms chpl 1.27.0
c 8-i.c 365ms 1.0ms 1.0MB 353ms 0ms gcc 12.2.0
c 5.c 367ms 0.2ms 1.1MB 357ms 0ms clang 11.0.0
c 2.c 407ms 0.8ms 1.1MB 400ms 0ms clang 11.0.0
c 2.c 624ms 0.4ms 1.0MB 610ms 0ms gcc 12.2.0

Input: 500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
c 8-i.c 33ms 1.5ms 0.6MB 20ms 0ms zigcc 0.10.0-dev.4192+c75e8f361
c 5.c 35ms 0.5ms 1.0MB 23ms 0ms gcc 12.2.0
c 5.c 35ms 0.3ms 0.6MB 30ms 0ms zigcc 0.10.0-dev.4192+c75e8f361
c 2.c 36ms 0.7ms 0.6MB 30ms 0ms zigcc 0.10.0-dev.4192+c75e8f361
c 8-i.c 38ms 1.0ms 1.1MB 30ms 0ms clang 11.0.0
c 8-i.c 40ms 1.0ms 1.0MB 30ms 0ms gcc 12.2.0
c 5.c 41ms 1.9ms 1.1MB 30ms 0ms clang 11.0.0
c 2.c 45ms 2.0ms 1.1MB 30ms 0ms clang 11.0.0
chapel 2.chpl 56ms 0.9ms 32.4MB 43ms 3ms chpl 1.27.0
c 2.c 66ms 0.5ms 1.0MB 57ms 0ms gcc 12.2.0

pidigits

Input: 8000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
chapel 2.chpl 596ms 3.4ms 34.1MB 580ms 3ms chpl 1.27.0

Input: 4000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
chapel 2.chpl 154ms 0.9ms 34.1MB 140ms 3ms chpl 1.27.0

regex-redux

Input: 2500000_in

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
chapel 3.chpl 2002ms 36ms 253.4MB 1867ms 123ms chpl 1.27.0

Input: 250000_in

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
chapel 3.chpl 220ms 0.4ms 56.8MB 197ms 10ms chpl 1.27.0

secp256k1

Input: 2000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
chapel 1.chpl 1529ms 2.4ms 32.3MB 1517ms 3ms chpl 1.27.0

Input: 500

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
chapel 1.chpl 399ms 1.3ms 32.3MB 383ms 7ms chpl 1.27.0

spectral-norm

Input: 8000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
c 4-m.c 1392ms 2.2ms 2.5MB 2730ms 0ms gcc 12.2.0
c 6-im.c 1599ms 30ms 1.0MB 3113ms 0ms gcc 12.2.0
c 6-im.c 1734ms 20ms 3.0MB 3393ms 3ms clang 11.0.0
c 4-m.c 1741ms 9.5ms 3.1MB 3407ms 3ms clang 11.0.0
c 5-im.c 1867ms 10ms 1.0MB 3633ms 3ms gcc 12.2.0
c 5-im.c 2025ms 2.3ms 3.1MB 3983ms 0ms clang 11.0.0
c 3-m.c 2214ms 16ms 1.0MB 4340ms 0ms gcc 12.2.0
c 3-m.c 2214ms 14ms 3.1MB 4343ms 0ms clang 11.0.0
chapel 1-m.chpl 2298ms 91ms 32.5MB 4440ms 7ms chpl 1.27.0
chapel 1.chpl 4377ms 4.9ms 32.5MB 4360ms 3ms chpl 1.27.0

Input: 4000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
c 4-m.c 361ms 5.9ms 1.0MB 687ms 0ms gcc 12.2.0
c 6-im.c 407ms 2.2ms 1.0MB 780ms 0ms gcc 12.2.0
c 6-im.c 443ms 3.8ms 2.9MB 847ms 0ms clang 11.0.0
c 4-m.c 445ms 2.6ms 2.9MB 853ms 0ms clang 11.0.0
c 5-im.c 473ms 2.2ms 1.0MB 907ms 0ms gcc 12.2.0
c 5-im.c 556ms 53ms 3.2MB 1013ms 0ms clang 11.0.0
c 3-m.c 562ms 3.7ms 1.0MB 1083ms 0ms gcc 12.2.0
c 3-m.c 566ms 5.1ms 3.0MB 1087ms 0ms clang 11.0.0
chapel 1-m.chpl 579ms 0.5ms 32.5MB 1113ms 3ms chpl 1.27.0
chapel 1.chpl 1111ms 1.2ms 32.4MB 1100ms 0ms chpl 1.27.0

Input: 2000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
c 4-m.c 98ms 1.2ms 1.0MB 170ms 0ms gcc 12.2.0
c 6-im.c 109ms 0.4ms 1.0MB 200ms 0ms gcc 12.2.0
c 6-im.c 118ms 0.4ms 3.1MB 210ms 0ms clang 11.0.0
c 4-m.c 119ms 1.4ms 2.9MB 210ms 0ms clang 11.0.0
c 5-im.c 129ms 2.7ms 1.0MB 227ms 0ms gcc 12.2.0
c 5-im.c 143ms 3.6ms 3.2MB 250ms 0ms clang 11.0.0
c 3-m.c 150ms 1.3ms 0.9MB 273ms 0ms gcc 12.2.0
c 3-m.c 151ms 2.6ms 3.0MB 273ms 0ms clang 11.0.0
chapel 1-m.chpl 165ms 1.6ms 32.5MB 290ms 0ms chpl 1.27.0
chapel 1.chpl 297ms 2.5ms 32.4MB 283ms 7ms chpl 1.27.0