Ubuntu 20.04
Ryzen 7 5800X, 3.8GHz, 8 core 16 threads, x86_64
Governor: performance
Hyperthreading disabled
Frequency boost disabled
16GB RAM
$ WARMUP=10000 REQUESTS=20000 ruby -v bench.rb
ruby 3.0.0p0 (2020-12-25 revision 95aff21468) [x86_64-linux]
warmup: 10000/10000
benchmark: 20000/20000
13361.05 rps
$ WARMUP=10000 REQUESTS=20000 ruby --jit-max-cache=10000 -v bench.rb
ruby 3.0.0p0 (2020-12-25 revision 95aff21468) +JIT [x86_64-linux]
warmup: 10000/10000
benchmark: 20000/20000
14821.66 rps
$ cd rails_test_app
$ WARMUP=10000 BENCHMARK=10000 ruby bin/bench
ruby 3.0.0p0 (2020-12-25 revision 95aff21468) [x86_64-linux]
Warming up...
Warmup: 10000 requests
Benchmark: 10000 requests
Request per second: 1593.2 [#/s] (mean)
Percentage of the requests served within a certain time (ms)
50% 0.60
66% 0.61
75% 0.67
80% 0.68
90% 0.70
95% 0.72
98% 0.74
99% 0.76
100% 11.75
$ WARMUP=10000 BENCHMARK=10000 ruby --jit-max-cache=10000 bin/bench
ruby 3.0.0p0 (2020-12-25 revision 95aff21468) +JIT [x86_64-linux]
Warming up...
Warmup: 10000 requests
Benchmark: 10000 requests
Request per second: 1656.4 [#/s] (mean)
Percentage of the requests served within a certain time (ms)
50% 0.57
66% 0.59
75% 0.64
80% 0.66
90% 0.68
95% 0.69
98% 0.71
99% 0.74
100% 12.22
$ bundle exec rake db:create db:migrate db:seed RAILS_ENV=production
$ bundle exec rake assets:precompile RAILS_ENV=production
$ WARMUP=10000 BENCHMARK=10000 ruby bin/bench
ruby 3.0.0p0 (2020-12-25 revision 95aff21468) [x86_64-linux]
Warming up...
Warmup: 10000 requests
Benchmark: 10000 requests
Request per second: 848.6 [#/s] (mean)
Percentage of the requests served within a certain time (ms)
50% 1.18
66% 1.21
75% 1.22
80% 1.22
90% 1.23
95% 1.25
98% 1.27
99% 1.62
100% 12.32
$ WARMUP=10000 BENCHMARK=10000 ruby --jit-max-cache=10000 bin/bench
ruby 3.0.0p0 (2020-12-25 revision 95aff21468) +JIT [x86_64-linux]
Warming up...
Warmup: 10000 requests
Benchmark: 10000 requests
Request per second: 872.1 [#/s] (mean)
Percentage of the requests served within a certain time (ms)
50% 1.14
66% 1.16
75% 1.17
80% 1.17
90% 1.20
95% 1.41
98% 1.55
99% 1.63
100% 19.32
$ docker-compose up
$ bundle exec rake db:create db:migrate RAILS_ENV=profile
$ ruby script/bench.rb
$ WARMUP=1000 BENCHMARK=1000 ruby bin/bench
ruby 3.0.0p0 (2020-12-25 revision 95aff21468) [x86_64-linux]
Warming up...
Warmup: 1000 requests
Benchmark: 1000 requests
Request per second: 14.1 [#/s] (mean)
Percentage of the requests served within a certain time (ms)
50% 69.44
66% 70.11
75% 70.77
80% 71.85
90% 74.30
95% 74.95
98% 75.79
99% 78.47
100% 196.12
$ WARMUP=1000 BENCHMARK=1000 ruby --jit-max-cache=10000 bin/bench
ruby 3.0.0p0 (2020-12-25 revision 95aff21468) +JIT [x86_64-linux]
Warming up...
Warmup: 1000 requests
Benchmark: 1000 requests
Request per second: 14.5 [#/s] (mean)
Percentage of the requests served within a certain time (ms)
50% 66.69
66% 67.61
75% 69.45
80% 70.41
90% 71.37
95% 72.37
98% 74.65
99% 132.63
100% 194.83
Railsbench vs --jit-max-cache
$ WARMUP=10000 BENCHMARK=10000 ruby bin/bench
ruby 3.0.0p0 (2020-12-25 revision 95aff21468) [x86_64-linux]
Warming up...
Warmup: 10000 requests
Benchmark: 10000 requests
Request per second: 862.1 [#/s] (mean)
Percentage of the requests served within a certain time (ms)
50% 1.16
66% 1.18
75% 1.19
80% 1.20
90% 1.21
95% 1.23
98% 1.27
99% 1.58
100% 12.54
$ for i in 100 200 300 400 500 600 700 800 900 1000 1100 1200; do echo "[$i]"; WARMUP=10000 BENCHMARK=10000 ruby --jit-max-cache=$i bin/bench; echo "-----"; done
[100]
ruby 3.0.0p0 (2020-12-25 revision 95aff21468) +JIT [x86_64-linux]
Warming up...
Warmup: 10000 requests
Benchmark: 10000 requests
Request per second: 849.3 [#/s] (mean)
Percentage of the requests served within a certain time (ms)
50% 1.18
66% 1.21
75% 1.21
80% 1.22
90% 1.23
95% 1.25
98% 1.30
99% 1.59
100% 12.97
-----
[200]
ruby 3.0.0p0 (2020-12-25 revision 95aff21468) +JIT [x86_64-linux]
Warming up...
Warmup: 10000 requests
Benchmark: 10000 requests
Request per second: 848.4 [#/s] (mean)
Percentage of the requests served within a certain time (ms)
50% 1.18
66% 1.20
75% 1.21
80% 1.21
90% 1.24
95% 1.29
98% 1.43
99% 1.61
100% 12.62
-----
[300]
ruby 3.0.0p0 (2020-12-25 revision 95aff21468) +JIT [x86_64-linux]
Warming up...
Warmup: 10000 requests
Benchmark: 10000 requests
Request per second: 841.2 [#/s] (mean)
Percentage of the requests served within a certain time (ms)
50% 1.19
66% 1.22
75% 1.23
80% 1.23
90% 1.24
95% 1.26
98% 1.30
99% 1.62
100% 8.11
-----
[400]
ruby 3.0.0p0 (2020-12-25 revision 95aff21468) +JIT [x86_64-linux]
Warming up...
Warmup: 10000 requests
Benchmark: 10000 requests
Request per second: 855.5 [#/s] (mean)
Percentage of the requests served within a certain time (ms)
50% 1.17
66% 1.20
75% 1.20
80% 1.21
90% 1.22
95% 1.24
98% 1.28
99% 1.60
100% 12.43
-----
[500]
ruby 3.0.0p0 (2020-12-25 revision 95aff21468) +JIT [x86_64-linux]
Warming up...
Warmup: 10000 requests
Benchmark: 10000 requests
Request per second: 853.1 [#/s] (mean)
Percentage of the requests served within a certain time (ms)
50% 1.17
66% 1.20
75% 1.21
80% 1.21
90% 1.22
95% 1.24
98% 1.28
99% 1.60
100% 12.43
-----
[600]
ruby 3.0.0p0 (2020-12-25 revision 95aff21468) +JIT [x86_64-linux]
Warming up...
Warmup: 10000 requests
Benchmark: 10000 requests
Request per second: 856.0 [#/s] (mean)
Percentage of the requests served within a certain time (ms)
50% 1.17
66% 1.20
75% 1.20
80% 1.21
90% 1.22
95% 1.24
98% 1.29
99% 1.61
100% 12.73
-----
[700]
ruby 3.0.0p0 (2020-12-25 revision 95aff21468) +JIT [x86_64-linux]
Warming up...
Warmup: 10000 requests
Benchmark: 10000 requests
Request per second: 855.5 [#/s] (mean)
Percentage of the requests served within a certain time (ms)
50% 1.17
66% 1.19
75% 1.20
80% 1.21
90% 1.22
95% 1.24
98% 1.29
99% 1.61
100% 13.23
-----
[800]
ruby 3.0.0p0 (2020-12-25 revision 95aff21468) +JIT [x86_64-linux]
Warming up...
Warmup: 10000 requests
Benchmark: 10000 requests
Request per second: 850.3 [#/s] (mean)
Percentage of the requests served within a certain time (ms)
50% 1.18
66% 1.21
75% 1.21
80% 1.22
90% 1.23
95% 1.25
98% 1.29
99% 1.65
100% 12.93
-----
[900]
ruby 3.0.0p0 (2020-12-25 revision 95aff21468) +JIT [x86_64-linux]
Warming up...
Warmup: 10000 requests
Benchmark: 10000 requests
Request per second: 861.4 [#/s] (mean)
Percentage of the requests served within a certain time (ms)
50% 1.16
66% 1.19
75% 1.20
80% 1.20
90% 1.21
95% 1.23
98% 1.27
99% 1.64
100% 12.86
-----
[1000]
ruby 3.0.0p0 (2020-12-25 revision 95aff21468) +JIT [x86_64-linux]
Warming up...
Warmup: 10000 requests
Benchmark: 10000 requests
Request per second: 861.2 [#/s] (mean)
Percentage of the requests served within a certain time (ms)
50% 1.16
66% 1.19
75% 1.19
80% 1.20
90% 1.21
95% 1.23
98% 1.28
99% 1.64
100% 12.88
-----
[1100]
ruby 3.0.0p0 (2020-12-25 revision 95aff21468) +JIT [x86_64-linux]
Warming up...
Warmup: 10000 requests
Benchmark: 10000 requests
Request per second: 879.6 [#/s] (mean)
Percentage of the requests served within a certain time (ms)
50% 1.13
66% 1.15
75% 1.16
80% 1.16
90% 1.19
95% 1.39
98% 1.52
99% 1.63
100% 23.48
-----
[1200]
ruby 3.0.0p0 (2020-12-25 revision 95aff21468) +JIT [x86_64-linux]
Warming up...
Warmup: 10000 requests
Benchmark: 10000 requests
Request per second: 880.3 [#/s] (mean)
Percentage of the requests served within a certain time (ms)
50% 1.14
66% 1.17
75% 1.17
80% 1.18
90% 1.19
95% 1.21
98% 1.25
99% 1.63
100% 12.38