All Ruby benchmarks

Current benchmark data was generated on Fri Dec 09 2022, full log can be found HERE

CONTRIBUTIONS are WELCOME!

[x86_64][2 cores] Intel(R) Xeon(R) Platinum 8272CL CPU @ 2.60GHz (Model 85)

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

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.rb timeout 0.0ms 0.0MB 0ms 0ms ruby 3.1.3
1.rb timeout 0.0ms 0.0MB 0ms 0ms ruby/yjit 3.1.3
1.rb timeout 0.0ms 0.0MB 0ms 0ms truffleruby 22.3.0

Input: 15

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.rb 1034ms 1.9ms 292.1MB 873ms 147ms ruby/yjit 3.1.3
1.rb 1057ms 6.6ms 35.5MB 1020ms 20ms ruby 3.1.3
1-m.rb 1147ms 21ms 428.0MB 1900ms 160ms truffleruby 22.3.0

coro-prime-sieve

Input: 4000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.rb 3406ms 77ms 336.8MB 3203ms 183ms ruby/yjit 3.1.3
1.rb 4759ms 65ms 80.1MB 4690ms 53ms ruby 3.1.3
1.rb timeout 0.0ms 0.0MB 0ms 0ms truffleruby 22.3.0

Input: 1000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.rb 295ms 0.8ms 42.3MB 260ms 20ms ruby 3.1.3
1.rb 425ms 4.3ms 298.8MB 250ms 160ms ruby/yjit 3.1.3
1.rb timeout 0.0ms 0.0MB 0ms 0ms truffleruby 22.3.0

fasta

Input: 2500000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
6-m.rb 2708ms 5.6ms 358.2MB 4840ms 303ms truffleruby 22.3.0
6.rb 2906ms 11ms 296.3MB 2740ms 150ms ruby/yjit 3.1.3
6.rb 4528ms 14ms 39.5MB 4490ms 20ms ruby 3.1.3

Input: 250000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
6.rb 521ms 1.0ms 31.0MB 497ms 10ms ruby 3.1.3
6.rb 528ms 2.0ms 287.8MB 370ms 140ms ruby/yjit 3.1.3
6-m.rb 856ms 16ms 320.0MB 1433ms 140ms truffleruby 22.3.0

helloworld

Input: QwQ

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.rb 45ms 3.8ms 155.0MB 24ms 20ms truffleruby 22.3.0
1.rb 71ms 1.1ms 29.9MB 52ms 4ms ruby 3.1.3
1.rb 257ms 1.4ms 286.7MB 110ms 136ms ruby/yjit 3.1.3

json-serde

Input: sample 5000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.rb 437ms 2.1ms 46.7MB 403ms 17ms ruby 3.1.3
1.rb 623ms 0.7ms 304.4MB 443ms 167ms ruby/yjit 3.1.3
1.rb timeout 0.0ms 0.0MB 0ms 0ms truffleruby 22.3.0

Input: canada 15

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.rb 3937ms 2.1ms 162.4MB 3820ms 97ms ruby 3.1.3
1.rb 4118ms 5.4ms 419.8MB 3897ms 203ms ruby/yjit 3.1.3
1.rb timeout 0.0ms 0.0MB 0ms 0ms truffleruby 22.3.0

lru

Input: 1000 1000000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.rb 654ms 2.3ms 287.0MB 493ms 140ms ruby/yjit 3.1.3
1.rb 660ms 5.7ms 30.4MB 633ms 10ms ruby 3.1.3
1-m.rb 842ms 23ms 318.7MB 1243ms 100ms truffleruby 22.3.0

Input: 1000 3000000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.rb 1448ms 16ms 287.1MB 1273ms 157ms ruby/yjit 3.1.3
1.rb 1638ms 61ms 351.3MB 2137ms 137ms truffleruby 22.3.0
1.rb 1813ms 10.0ms 30.4MB 1783ms 17ms ruby 3.1.3

Input: 100 500000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.rb 362ms 1.3ms 30.4MB 333ms 13ms ruby 3.1.3
1.rb 456ms 3.7ms 287.0MB 300ms 140ms ruby/yjit 3.1.3
1-m.rb 640ms 19ms 309.0MB 933ms 120ms truffleruby 22.3.0

merkletrees

Input: 17

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.rb timeout 0.0ms 0.0MB 0ms 0ms ruby 3.1.3
1.rb timeout 0.0ms 0.0MB 0ms 0ms ruby/yjit 3.1.3
1.rb timeout 0.0ms 0.0MB 0ms 0ms truffleruby 22.3.0

Input: 15

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1-m.rb 3539ms 24ms 576.4MB 6470ms 250ms truffleruby 22.3.0
1.rb 3989ms 12ms 300.8MB 3823ms 153ms ruby/yjit 3.1.3
1.rb 4696ms 12ms 44.3MB 4667ms 13ms ruby 3.1.3

nbody

Input: 5000000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
2.rb 1219ms 32ms 305.7MB 1467ms 93ms truffleruby 22.3.0
2.rb timeout 0.0ms 0.0MB 0ms 0ms ruby 3.1.3
2.rb timeout 0.0ms 0.0MB 0ms 0ms ruby/yjit 3.1.3

Input: 500000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
2-m.rb 447ms 28ms 316.0MB 653ms 127ms truffleruby 22.3.0
2.rb 2409ms 3.5ms 286.9MB 2243ms 147ms ruby/yjit 3.1.3
2.rb 3443ms 15ms 30.0MB 3420ms 13ms ruby 3.1.3

nsieve

Input: 12

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.rb timeout 0.0ms 0.0MB 0ms 0ms ruby 3.1.3
1.rb timeout 0.0ms 0.0MB 0ms 0ms ruby/yjit 3.1.3
1.rb timeout 0.0ms 0.0MB 0ms 0ms truffleruby 22.3.0

Input: 10

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.rb 3230ms 44ms 420.3MB 3753ms 147ms truffleruby 22.3.0
1.rb timeout 0.0ms 0.0MB 0ms 0ms ruby 3.1.3
1.rb timeout 0.0ms 0.0MB 0ms 0ms ruby/yjit 3.1.3

pidigits

Input: 8000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.rb timeout 0.0ms 0.0MB 0ms 0ms ruby 3.1.3
1.rb timeout 0.0ms 0.0MB 0ms 0ms ruby/yjit 3.1.3
1.rb timeout 0.0ms 0.0MB 0ms 0ms truffleruby 22.3.0

Input: 4000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1-m.rb 2271ms 61ms 391.6MB 4173ms 163ms truffleruby 22.3.0
1.rb 3128ms 3.7ms 161.6MB 3030ms 80ms ruby 3.1.3
1.rb 3289ms 7.0ms 418.4MB 3080ms 197ms ruby/yjit 3.1.3

spectral-norm

Input: 8000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
4.rb timeout 0.0ms 0.0MB 0ms 0ms ruby 3.1.3
4.rb timeout 0.0ms 0.0MB 0ms 0ms ruby/yjit 3.1.3
4.rb timeout 0.0ms 0.0MB 0ms 0ms truffleruby 22.3.0

Input: 4000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
4.rb timeout 0.0ms 0.0MB 0ms 0ms ruby 3.1.3
4.rb timeout 0.0ms 0.0MB 0ms 0ms ruby/yjit 3.1.3
4.rb timeout 0.0ms 0.0MB 0ms 0ms truffleruby 22.3.0

Input: 2000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
4.rb 2821ms 20ms 404.7MB 3360ms 157ms truffleruby 22.3.0
4.rb timeout 0.0ms 0.0MB 0ms 0ms ruby 3.1.3
4.rb timeout 0.0ms 0.0MB 0ms 0ms ruby/yjit 3.1.3