Chapel VS C benchmarks

Current benchmark data was generated on Tue Mar 25 2025, 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
chapel 3.chpl 2069ms 6.5ms 60.3MB 2057ms 0ms chpl 1.31.0
chapel 4.chpl 2076ms 200ms 62.2MB 2063ms 3ms chpl 1.31.0

Input: 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
chapel 3.chpl 188ms 1.6ms 32.2MB 180ms 0ms chpl 1.31.0
chapel 4.chpl 196ms 21ms 32.3MB 190ms 0ms chpl 1.31.0

coro-prime-sieve

Input: 4000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
chapel 1-m.chpl 2266ms 93ms 525.8MB 4393ms 80ms chpl 1.31.0

Input: 1000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
chapel 1-m.chpl 198ms 4.8ms 494.6MB 317ms 50ms chpl 1.31.0

edigits

Input: 250001

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
chapel 1.chpl 73ms 2.7ms 32.5MB 70ms 0ms chpl 1.31.0

Input: 100000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
chapel 1.chpl 34ms 1.3ms 30.5MB 30ms 0ms chpl 1.31.0

fasta

Input: 2500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
chapel 5-m.chpl 106ms 1.8ms 28.3MB 190ms 0ms chpl 1.31.0

Input: 250000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
chapel 5.chpl 21ms 1.3ms 28.4MB 20ms 0ms chpl 1.31.0

helloworld

Input: QwQ

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
c 1.c 1.0ms 0.0ms 1.4MB 0ms 0ms zigcc 0.14.0
c 1.c 1.2ms 0.1ms 2.1MB 0ms 0ms gcc 14.2.0
c 1.c 1.3ms 0.1ms 2.1MB 0ms 0ms clang 14.0.0-1ubuntu1.1
chapel 1.chpl 11ms 0.5ms 28.8MB 0ms 0ms chpl 1.31.0

knucleotide

Input: 2500000_in

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
c 1-m.c 178ms 4.6ms 22.8MB 420ms 3ms gcc 14.2.0
c 1-m.c 317ms 51ms 25.9MB 1090ms 27ms clang 14.0.0-1ubuntu1.1
chapel 3-m.chpl 747ms 1.1ms 87.0MB 1410ms 10ms chpl 1.31.0

Input: 250000_in

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
c 1-m.c 28ms 1.6ms 13.9MB 63ms 0ms gcc 14.2.0
c 1-m.c 36ms 0.8ms 15.1MB 100ms 3ms clang 14.0.0-1ubuntu1.1
chapel 3-m.chpl 116ms 0.5ms 87.0MB 200ms 3ms chpl 1.31.0

nbody

Input: 5000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
c 8-i.c 270ms 3.5ms 1.5MB 263ms 0ms zigcc 0.14.0
c 8-i.c 303ms 0.8ms 2.1MB 290ms 0ms clang 14.0.0-1ubuntu1.1
c 2.c 310ms 0.8ms 2.3MB 300ms 0ms gcc 14.2.0
c 5.c 313ms 0.8ms 2.3MB 307ms 0ms gcc 14.2.0
c 5.c 317ms 0.3ms 2.1MB 310ms 0ms clang 14.0.0-1ubuntu1.1
c 2.c 317ms 5.6ms 1.5MB 303ms 0ms zigcc 0.14.0
c 5.c 318ms 3.5ms 1.5MB 310ms 0ms zigcc 0.14.0
c 2.c 318ms 2.2ms 2.1MB 310ms 0ms clang 14.0.0-1ubuntu1.1
chapel 2.chpl 326ms 5.3ms 28.9MB 317ms 0ms chpl 1.31.0
c 8-i.c 333ms 0.4ms 2.3MB 320ms 0ms gcc 14.2.0

Input: 500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
c 8-i.c 31ms 4.1ms 1.5MB 23ms 0ms zigcc 0.14.0
c 8-i.c 34ms 0.5ms 2.3MB 27ms 0ms clang 14.0.0-1ubuntu1.1
c 2.c 34ms 0.5ms 2.3MB 30ms 0ms gcc 14.2.0
c 2.c 34ms 0.3ms 1.5MB 30ms 0ms zigcc 0.14.0
c 5.c 34ms 0.1ms 2.3MB 30ms 0ms clang 14.0.0-1ubuntu1.1
c 5.c 34ms 0.3ms 2.3MB 30ms 0ms gcc 14.2.0
c 5.c 35ms 0.6ms 1.5MB 30ms 0ms zigcc 0.14.0
c 8-i.c 36ms 0.2ms 2.3MB 30ms 0ms gcc 14.2.0
c 2.c 40ms 2.3ms 2.1MB 30ms 0ms clang 14.0.0-1ubuntu1.1
chapel 2.chpl 45ms 2.3ms 28.8MB 40ms 0ms chpl 1.31.0

pidigits

Input: 8000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
chapel 2.chpl 446ms 2.3ms 28.4MB 440ms 0ms chpl 1.31.0

Input: 4000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
chapel 2.chpl 116ms 1.2ms 30.3MB 110ms 0ms chpl 1.31.0

regex-redux

Input: 2500000_in

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
chapel 3.chpl 1399ms 7.7ms 222.1MB 1347ms 43ms chpl 1.31.0

Input: 250000_in

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
chapel 3.chpl 164ms 2.9ms 49.0MB 150ms 10ms chpl 1.31.0

secp256k1

Input: 2000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
chapel 1.chpl 1181ms 3.6ms 29.2MB 1177ms 0ms chpl 1.31.0

Input: 500

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
chapel 1.chpl 308ms 2.9ms 29.0MB 303ms 0ms chpl 1.31.0

spectral-norm

Input: 8000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
c 6-im.c 958ms 2.2ms 2.0MB 3770ms 0ms gcc 14.2.0
c 4-m.c 968ms 2.7ms 2.0MB 3810ms 0ms gcc 14.2.0
c 6-im.c 1011ms 12ms 3.3MB 3953ms 7ms clang 14.0.0-1ubuntu1.1
c 5-im.c 1099ms 17ms 2.0MB 4293ms 3ms gcc 14.2.0
c 4-m.c 1132ms 16ms 3.1MB 4430ms 7ms clang 14.0.0-1ubuntu1.1
c 5-im.c 1333ms 5.5ms 3.3MB 5243ms 3ms clang 14.0.0-1ubuntu1.1
c 3-m.c 1845ms 24ms 3.3MB 7243ms 10ms clang 14.0.0-1ubuntu1.1
chapel 1-m.chpl 1928ms 19ms 28.8MB 3830ms 0ms chpl 1.31.0
c 3-m.c 1975ms 10ms 2.3MB 7780ms 7ms gcc 14.2.0
chapel 1.chpl 3725ms 17ms 28.8MB 3720ms 0ms chpl 1.31.0

Input: 4000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
c 6-im.c 247ms 0.9ms 2.0MB 943ms 0ms gcc 14.2.0
c 4-m.c 252ms 1.3ms 2.1MB 967ms 0ms gcc 14.2.0
c 6-im.c 263ms 2.8ms 3.3MB 993ms 0ms clang 14.0.0-1ubuntu1.1
c 5-im.c 287ms 8.2ms 2.0MB 1100ms 0ms gcc 14.2.0
c 4-m.c 289ms 1.7ms 3.3MB 1110ms 0ms clang 14.0.0-1ubuntu1.1
c 5-im.c 342ms 1.1ms 3.3MB 1313ms 0ms clang 14.0.0-1ubuntu1.1
chapel 1-m.chpl 492ms 0.6ms 28.5MB 957ms 0ms chpl 1.31.0
c 3-m.c 496ms 43ms 3.3MB 1873ms 7ms clang 14.0.0-1ubuntu1.1
c 3-m.c 497ms 0.9ms 2.0MB 1940ms 0ms gcc 14.2.0
chapel 1.chpl 940ms 1.1ms 28.8MB 933ms 0ms chpl 1.31.0

Input: 2000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
c 4-m.c 71ms 0.4ms 2.0MB 257ms 0ms gcc 14.2.0
c 6-im.c 73ms 4.0ms 3.3MB 253ms 0ms clang 14.0.0-1ubuntu1.1
c 6-im.c 75ms 7.5ms 2.0MB 263ms 0ms gcc 14.2.0
c 5-im.c 79ms 1.5ms 2.0MB 280ms 0ms gcc 14.2.0
c 4-m.c 79ms 0.8ms 3.1MB 280ms 0ms clang 14.0.0-1ubuntu1.1
c 5-im.c 92ms 1.5ms 3.1MB 327ms 0ms clang 14.0.0-1ubuntu1.1
c 3-m.c 126ms 3.1ms 3.1MB 453ms 0ms clang 14.0.0-1ubuntu1.1
c 3-m.c 131ms 1.1ms 2.0MB 493ms 0ms gcc 14.2.0
chapel 1-m.chpl 135ms 1.0ms 28.9MB 240ms 0ms chpl 1.31.0
chapel 1.chpl 247ms 2.4ms 28.8MB 240ms 0ms chpl 1.31.0