Chapel VS Ruby benchmarks

Current benchmark data was generated on Sun Jun 01 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 4.chpl 1954ms 6.5ms 62.3MB 1947ms 0ms chpl 1.31.0
chapel 3.chpl 2047ms 28ms 60.3MB 2040ms 3ms chpl 1.31.0
ruby 1-m.rb 4549ms 73ms 838.0MB 6403ms 490ms truffleruby 24.2.1
ruby 1.rb 4697ms 113ms 110.0MB 4607ms 77ms ruby/yjit 3.4.4
ruby 1.rb timeout 0.0ms 70.4MB 4953ms 37ms ruby 3.4.4

Input: 15

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
chapel 4.chpl 185ms 3.6ms 32.4MB 180ms 0ms chpl 1.31.0
chapel 3.chpl 185ms 0.6ms 32.2MB 180ms 0ms chpl 1.31.0
ruby 1.rb 489ms 7.3ms 20.3MB 463ms 10ms ruby/yjit 3.4.4
ruby 1-m.rb 502ms 12ms 405.6MB 983ms 153ms truffleruby 24.2.1
ruby 1.rb 948ms 7.8ms 19.5MB 927ms 10ms ruby 3.4.4

coro-prime-sieve

Input: 4000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
ruby 1.rb 1405ms 6.4ms 63.8MB 1330ms 60ms ruby/yjit 3.4.4
ruby 1.rb 1867ms 34ms 63.0MB 1787ms 63ms ruby 3.4.4
chapel 1-m.chpl 2211ms 79ms 480.1MB 4320ms 70ms chpl 1.31.0
ruby 1.rb timeout 0.0ms 348.7MB 4700ms 1477ms truffleruby 24.2.1

Input: 1000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
ruby 1.rb 152ms 1.3ms 25.6MB 123ms 13ms ruby/yjit 3.4.4
chapel 1-m.chpl 179ms 0.7ms 445.0MB 293ms 40ms chpl 1.31.0
ruby 1.rb 182ms 1.0ms 25.0MB 150ms 13ms ruby 3.4.4
ruby 1.rb timeout 0.0ms 356.8MB 4790ms 1430ms truffleruby 24.2.1

edigits

Input: 250001

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
chapel 1.chpl 71ms 1.5ms 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 33ms 2.6ms 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 104ms 1.5ms 28.3MB 190ms 0ms chpl 1.31.0
ruby 6.rb 2020ms 7.1ms 23.0MB 1993ms 13ms ruby/yjit 3.4.4
ruby 6-m.rb 2228ms 213ms 408.8MB 5793ms 337ms truffleruby 24.2.1
ruby 6.rb 3691ms 14ms 22.4MB 3667ms 10ms ruby 3.4.4

Input: 250000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
chapel 5.chpl 21ms 0.7ms 28.4MB 20ms 0ms chpl 1.31.0
ruby 6.rb 255ms 2.3ms 15.2MB 240ms 0ms ruby/yjit 3.4.4
ruby 6.rb 420ms 5.4ms 14.5MB 403ms 0ms ruby 3.4.4
ruby 6-m.rb 729ms 109ms 365.6MB 1803ms 163ms truffleruby 24.2.1

helloworld

Input: QwQ

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
chapel 1.chpl 9.3ms 1.5ms 28.8MB 0ms 0ms chpl 1.31.0
ruby 1.rb 34ms 0.5ms 141.5MB 10ms 26ms truffleruby 24.2.1
ruby 1.rb 50ms 1.4ms 12.9MB 38ms 2ms ruby/yjit 3.4.4
ruby 1.rb 51ms 1.7ms 12.8MB 36ms 2ms ruby 3.4.4

knucleotide

Input: 2500000_in

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
chapel 3-m.chpl 747ms 5.4ms 87.2MB 1417ms 10ms chpl 1.31.0

Input: 250000_in

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
chapel 3-m.chpl 113ms 1.0ms 87.0MB 200ms 0ms chpl 1.31.0

nbody

Input: 5000000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
chapel 2.chpl 322ms 1.7ms 28.8MB 320ms 0ms chpl 1.31.0
ruby 2.rb 823ms 8.8ms 310.2MB 1070ms 110ms truffleruby 24.2.1
ruby 2.rb timeout 0.0ms 12.8MB 4983ms 3ms ruby 3.4.4
ruby 2.rb timeout 0.0ms 13.5MB 4983ms 3ms ruby/yjit 3.4.4

Input: 500000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
chapel 2.chpl 44ms 1.3ms 28.9MB 40ms 0ms chpl 1.31.0
ruby 2-m.rb 323ms 5.2ms 325.5MB 593ms 110ms truffleruby 24.2.1
ruby 2.rb 1025ms 6.4ms 13.5MB 1010ms 3ms ruby/yjit 3.4.4
ruby 2.rb 2919ms 94ms 12.8MB 2903ms 3ms ruby 3.4.4

pidigits

Input: 8000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
chapel 2.chpl 444ms 0.7ms 30.4MB 440ms 0ms chpl 1.31.0
ruby 1.rb timeout 0.0ms 130.3MB 4870ms 113ms ruby 3.4.4
ruby 1.rb timeout 0.0ms 131.1MB 4837ms 147ms ruby/yjit 3.4.4
ruby 1.rb timeout 0.0ms 465.0MB 13420ms 380ms truffleruby 24.2.1

Input: 4000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
chapel 2.chpl 113ms 1.8ms 30.4MB 110ms 0ms chpl 1.31.0
ruby 1-m.rb 1723ms 255ms 383.7MB 4550ms 200ms truffleruby 24.2.1
ruby 1.rb 1760ms 71ms 130.8MB 1653ms 93ms ruby/yjit 3.4.4
ruby 1.rb 1813ms 6.5ms 130.4MB 1677ms 123ms ruby 3.4.4

regex-redux

Input: 2500000_in

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
chapel 3.chpl 1387ms 3.3ms 220.1MB 1343ms 40ms chpl 1.31.0

Input: 250000_in

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
chapel 3.chpl 163ms 3.8ms 49.0MB 143ms 13ms 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 6.5ms 29.1MB 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 307ms 4.2ms 29.1MB 303ms 0ms chpl 1.31.0

spectral-norm

Input: 8000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
chapel 1-m.chpl 1922ms 11ms 29.0MB 3817ms 0ms chpl 1.31.0
chapel 1.chpl 3716ms 4.8ms 28.8MB 3710ms 0ms chpl 1.31.0
ruby 4.rb timeout 0.0ms 12.9MB 4983ms 3ms ruby 3.4.4
ruby 4.rb timeout 0.0ms 13.5MB 4980ms 3ms ruby/yjit 3.4.4
ruby 4.rb timeout 0.0ms 436.2MB 5167ms 233ms truffleruby 24.2.1

Input: 4000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
chapel 1-m.chpl 492ms 1.0ms 28.9MB 957ms 0ms chpl 1.31.0
chapel 1.chpl 940ms 1.7ms 28.8MB 940ms 0ms chpl 1.31.0
ruby 4.rb 4820ms 15ms 423.5MB 5103ms 203ms truffleruby 24.2.1
ruby 4.rb timeout 0.0ms 12.9MB 4987ms 3ms ruby 3.4.4
ruby 4.rb timeout 0.0ms 13.5MB 4980ms 0ms ruby/yjit 3.4.4

Input: 2000

lang code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
chapel 1-m.chpl 133ms 1.1ms 28.9MB 240ms 0ms chpl 1.31.0
chapel 1.chpl 246ms 3.6ms 28.8MB 240ms 0ms chpl 1.31.0
ruby 4.rb 1453ms 19ms 405.2MB 1797ms 150ms truffleruby 24.2.1
ruby 4.rb timeout 0.0ms 12.9MB 4983ms 7ms ruby 3.4.4
ruby 4.rb timeout 0.0ms 13.6MB 4980ms 7ms ruby/yjit 3.4.4