All Ruby benchmarks

Current benchmark data was generated on Fri Jul 01 2022, full log can be found HERE

CONTRIBUTIONS are WELCOME!

[x86_64][2 cores] Intel(R) Xeon(R) Platinum 8171M 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.2
1.rb timeout 0.0ms 0.0MB 0ms 0ms ruby/yjit 3.1.2
1.rb timeout 0.0ms 0.0MB 0ms 0ms truffleruby 22.1.0

Input: 15

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.rb 1274ms 11ms 292.1MB 1093ms 163ms ruby/yjit 3.1.2
1-m.rb 1306ms 48ms 383.1MB 2173ms 163ms truffleruby 22.1.0
1.rb 1342ms 20ms 35.5MB 1297ms 27ms ruby 3.1.2

coro-prime-sieve

Input: 4000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.rb 4458ms 33ms 336.6MB 4230ms 207ms ruby/yjit 3.1.2
1.rb timeout 0.0ms 0.0MB 0ms 0ms ruby 3.1.2
1.rb timeout 0.0ms 0.0MB 0ms 0ms truffleruby 22.1.0

Input: 1000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.rb 354ms 0.8ms 42.3MB 307ms 33ms ruby 3.1.2
1.rb 508ms 9.7ms 298.8MB 317ms 177ms ruby/yjit 3.1.2
1.rb timeout 0.0ms 0.0MB 0ms 0ms truffleruby 22.1.0

fasta

Input: 2500000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
6.rb 3568ms 38ms 295.9MB 3367ms 180ms ruby/yjit 3.1.2
6.rb timeout 0.0ms 0.0MB 0ms 0ms ruby 3.1.2
6.rb timeout 0.0ms 0.0MB 0ms 0ms truffleruby 22.1.0

Input: 250000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
6.rb 626ms 0.5ms 31.2MB 590ms 17ms ruby 3.1.2
6.rb 652ms 6.3ms 287.7MB 460ms 173ms ruby/yjit 3.1.2
6-m.rb 2027ms 16ms 365.4MB 3610ms 177ms truffleruby 22.1.0

helloworld

Input: QwQ

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.rb 55ms 2.2ms 136.6MB 30ms 26ms truffleruby 22.1.0
1.rb 89ms 3.9ms 30.0MB 62ms 12ms ruby 3.1.2
1.rb 301ms 1.0ms 286.7MB 124ms 160ms ruby/yjit 3.1.2

json-serde

Input: sample 5000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.rb 543ms 12ms 49.1MB 497ms 27ms ruby 3.1.2
1.rb 746ms 1.9ms 306.4MB 550ms 180ms ruby/yjit 3.1.2
1.rb timeout 0.0ms 0.0MB 0ms 0ms truffleruby 22.1.0

Input: canada 15

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.rb 4870ms 23ms 163.2MB 4727ms 130ms ruby 3.1.2
1.rb timeout 0.0ms 0.0MB 0ms 0ms ruby/yjit 3.1.2
1.rb timeout 0.0ms 0.0MB 0ms 0ms truffleruby 22.1.0

lru

Input: 1000 1000000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.rb 810ms 13ms 286.7MB 630ms 163ms ruby/yjit 3.1.2
1.rb 852ms 8.9ms 30.2MB 820ms 13ms ruby 3.1.2
1-m.rb 1307ms 11ms 317.4MB 1973ms 170ms truffleruby 22.1.0

Input: 1000 3000000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.rb 1782ms 19ms 286.7MB 1617ms 150ms ruby/yjit 3.1.2
1-m.rb 2298ms 34ms 349.9MB 3253ms 277ms truffleruby 22.1.0
1.rb 2334ms 9.9ms 30.2MB 2310ms 10ms ruby 3.1.2

Input: 100 500000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1.rb 461ms 5.8ms 29.9MB 430ms 17ms ruby 3.1.2
1.rb 555ms 6.4ms 286.7MB 387ms 150ms ruby/yjit 3.1.2
1-m.rb 976ms 49ms 307.6MB 1510ms 160ms truffleruby 22.1.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.2
1.rb timeout 0.0ms 0.0MB 0ms 0ms ruby/yjit 3.1.2
1.rb timeout 0.0ms 0.0MB 0ms 0ms truffleruby 22.1.0

Input: 15

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1-m.rb 4441ms 29ms 575.8MB 8110ms 297ms truffleruby 22.1.0
1.rb 4986ms 21ms 300.9MB 4793ms 173ms ruby/yjit 3.1.2
1.rb timeout 0.0ms 0.0MB 0ms 0ms ruby 3.1.2

nbody

Input: 5000000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
2.rb 1848ms 68ms 303.0MB 2323ms 130ms truffleruby 22.1.0
2.rb timeout 0.0ms 0.0MB 0ms 0ms ruby 3.1.2
2.rb timeout 0.0ms 0.0MB 0ms 0ms ruby/yjit 3.1.2

Input: 500000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
2-m.rb 649ms 21ms 296.6MB 1040ms 123ms truffleruby 22.1.0
2.rb 2927ms 33ms 286.8MB 2737ms 177ms ruby/yjit 3.1.2
2.rb 3978ms 23ms 30.0MB 3947ms 17ms ruby 3.1.2

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.2
1.rb timeout 0.0ms 0.0MB 0ms 0ms ruby/yjit 3.1.2
1.rb timeout 0.0ms 0.0MB 0ms 0ms truffleruby 22.1.0

Input: 10

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.2
1.rb timeout 0.0ms 0.0MB 0ms 0ms ruby/yjit 3.1.2
1.rb timeout 0.0ms 0.0MB 0ms 0ms truffleruby 22.1.0

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.2
1.rb timeout 0.0ms 0.0MB 0ms 0ms ruby/yjit 3.1.2
1.rb timeout 0.0ms 0.0MB 0ms 0ms truffleruby 22.1.0

Input: 4000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
1-m.rb 2829ms 51ms 377.2MB 5153ms 227ms truffleruby 22.1.0
1.rb 3543ms 46ms 162.9MB 3427ms 93ms ruby 3.1.2
1.rb 3740ms 31ms 420.8MB 3457ms 263ms ruby/yjit 3.1.2

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.2
4.rb timeout 0.0ms 0.0MB 0ms 0ms ruby/yjit 3.1.2
4.rb timeout 0.0ms 0.0MB 0ms 0ms truffleruby 22.1.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.2
4.rb timeout 0.0ms 0.0MB 0ms 0ms ruby/yjit 3.1.2
4.rb timeout 0.0ms 0.0MB 0ms 0ms truffleruby 22.1.0

Input: 2000

code time stddev peak-mem mem time(user) time(sys) compiler compiler/runtime
4.rb 2919ms 42ms 352.5MB 3707ms 203ms truffleruby 22.1.0
4.rb timeout 0.0ms 0.0MB 0ms 0ms ruby 3.1.2
4.rb timeout 0.0ms 0.0MB 0ms 0ms ruby/yjit 3.1.2