From 77294f3098ad7e785b202d1a7a4ae8927fdf3cf1 Mon Sep 17 00:00:00 2001 From: Jean Boussier Date: Tue, 11 Feb 2025 20:58:01 +0100 Subject: [PATCH] Update lobsters benchmark to Rails 8.0 Fix: https://github.com/Shopify/yjit-bench/pull/358 Before: ``` inline_code_size: 6,752,176 outlined_code_size: 2,067,600 code_region_size: 17,268,736 yjit_alloc_size: 25,934,245 yjit_compile_time: 989.69ms RSS: 393.7MiB MAXRSS: 393.9MiB Average of last 15, non-warmup iters: 299ms Total time spent benchmarking: 27s interp: ruby 3.4.1 (2024-12-25 revision 48d4efcb85) +PRISM [arm64-darwin23] yjit: ruby 3.4.1 (2024-12-25 revision 48d4efcb85) +YJIT +PRISM [arm64-darwin23] -------- ----------- ---------- --------- ---------- ------------ ----------- bench interp (ms) stddev (%) yjit (ms) stddev (%) yjit 1st itr interp/yjit lobsters 463.9 1.3 299.8 2.6 0.563 1.547 -------- ----------- ---------- --------- ---------- ------------ ----------- ``` After: ``` inline_code_size: 6,808,680 outlined_code_size: 2,178,968 code_region_size: 17,448,960 yjit_alloc_size: 26,006,453 yjit_compile_time: 978.48ms RSS: 380.1MiB MAXRSS: 380.3MiB Average of last 16, non-warmup iters: 296ms Total time spent benchmarking: 27s interp: ruby 3.4.1 (2024-12-25 revision 48d4efcb85) +PRISM [arm64-darwin23] yjit: ruby 3.4.1 (2024-12-25 revision 48d4efcb85) +YJIT +PRISM [arm64-darwin23] -------- ----------- ---------- --------- ---------- ------------ ----------- bench interp (ms) stddev (%) yjit (ms) stddev (%) yjit 1st itr interp/yjit lobsters 463.1 1.8 296.3 2.2 0.596 1.563 -------- ----------- ---------- --------- ---------- ------------ ----------- ``` --- benchmarks/lobsters/Gemfile | 2 +- benchmarks/lobsters/Gemfile.lock | 142 +++++++++--------- benchmarks/lobsters/config/application.rb | 2 +- .../config/environments/production.rb | 1 - 4 files changed, 76 insertions(+), 71 deletions(-) diff --git a/benchmarks/lobsters/Gemfile b/benchmarks/lobsters/Gemfile index b4e5f8a3..44b7ec58 100644 --- a/benchmarks/lobsters/Gemfile +++ b/benchmarks/lobsters/Gemfile @@ -6,7 +6,7 @@ source "https://rubygems.org" actiontext activejob activemodel activerecord activestorage activesupport railties ].each do |rails_gem| - gem rails_gem, "~> 7.2" + gem rails_gem, "~> 8.0" end gem "sqlite3" diff --git a/benchmarks/lobsters/Gemfile.lock b/benchmarks/lobsters/Gemfile.lock index 61da6962..cc599d01 100644 --- a/benchmarks/lobsters/Gemfile.lock +++ b/benchmarks/lobsters/Gemfile.lock @@ -2,26 +2,25 @@ GEM remote: https://rubygems.org/ specs: Ascii85 (1.1.0) - actionmailbox (7.2.2.1) - actionpack (= 7.2.2.1) - activejob (= 7.2.2.1) - activerecord (= 7.2.2.1) - activestorage (= 7.2.2.1) - activesupport (= 7.2.2.1) + actionmailbox (8.0.1) + actionpack (= 8.0.1) + activejob (= 8.0.1) + activerecord (= 8.0.1) + activestorage (= 8.0.1) + activesupport (= 8.0.1) mail (>= 2.8.0) - actionmailer (7.2.2.1) - actionpack (= 7.2.2.1) - actionview (= 7.2.2.1) - activejob (= 7.2.2.1) - activesupport (= 7.2.2.1) + actionmailer (8.0.1) + actionpack (= 8.0.1) + actionview (= 8.0.1) + activejob (= 8.0.1) + activesupport (= 8.0.1) mail (>= 2.8.0) rails-dom-testing (~> 2.2) - actionpack (7.2.2.1) - actionview (= 7.2.2.1) - activesupport (= 7.2.2.1) + actionpack (8.0.1) + actionview (= 8.0.1) + activesupport (= 8.0.1) nokogiri (>= 1.8.5) - racc - rack (>= 2.2.4, < 3.2) + rack (>= 2.2.4) rack-session (>= 1.0.1) rack-test (>= 0.6.3) rails-dom-testing (~> 2.2) @@ -29,37 +28,37 @@ GEM useragent (~> 0.16) actionpack-page_caching (1.2.4) actionpack (>= 4.0.0) - actiontext (7.2.2.1) - actionpack (= 7.2.2.1) - activerecord (= 7.2.2.1) - activestorage (= 7.2.2.1) - activesupport (= 7.2.2.1) + actiontext (8.0.1) + actionpack (= 8.0.1) + activerecord (= 8.0.1) + activestorage (= 8.0.1) + activesupport (= 8.0.1) globalid (>= 0.6.0) nokogiri (>= 1.8.5) - actionview (7.2.2.1) - activesupport (= 7.2.2.1) + actionview (8.0.1) + activesupport (= 8.0.1) builder (~> 3.1) erubi (~> 1.11) rails-dom-testing (~> 2.2) rails-html-sanitizer (~> 1.6) - activejob (7.2.2.1) - activesupport (= 7.2.2.1) + activejob (8.0.1) + activesupport (= 8.0.1) globalid (>= 0.3.6) - activemodel (7.2.2.1) - activesupport (= 7.2.2.1) - activerecord (7.2.2.1) - activemodel (= 7.2.2.1) - activesupport (= 7.2.2.1) + activemodel (8.0.1) + activesupport (= 8.0.1) + activerecord (8.0.1) + activemodel (= 8.0.1) + activesupport (= 8.0.1) timeout (>= 0.4.0) activerecord-typedstore (1.6.0) activerecord (>= 6.1) - activestorage (7.2.2.1) - actionpack (= 7.2.2.1) - activejob (= 7.2.2.1) - activerecord (= 7.2.2.1) - activesupport (= 7.2.2.1) + activestorage (8.0.1) + actionpack (= 8.0.1) + activejob (= 8.0.1) + activerecord (= 8.0.1) + activesupport (= 8.0.1) marcel (~> 1.0) - activesupport (7.2.2.1) + activesupport (8.0.1) base64 benchmark (>= 0.3) bigdecimal @@ -71,6 +70,7 @@ GEM minitest (>= 5.1) securerandom (>= 0.3) tzinfo (~> 2.0, >= 2.0.5) + uri (>= 0.13.1) addressable (2.8.6) public_suffix (>= 2.0.2, < 6.0) afm (0.2.2) @@ -78,7 +78,7 @@ GEM base64 (0.2.0) bcrypt (3.1.20) benchmark (0.4.0) - bigdecimal (3.1.8) + bigdecimal (3.1.9) builder (3.2.4) byebug (11.1.3) capybara (3.39.2) @@ -93,7 +93,7 @@ GEM chunky_png (1.4.0) commonmarker (0.23.10) concurrent-ruby (1.3.4) - connection_pool (2.4.1) + connection_pool (2.5.0) crack (0.4.5) rexml crass (1.0.6) @@ -107,7 +107,7 @@ GEM diff-lcs (1.5.0) docile (1.4.0) drb (2.2.1) - erubi (1.13.0) + erubi (1.13.1) factory_bot (6.4.5) activesupport (>= 5.0.0) factory_bot_rails (6.4.3) @@ -124,8 +124,9 @@ GEM htmlentities (4.3.4) i18n (1.14.5) concurrent-ruby (~> 1.0) - io-console (0.7.2) - irb (1.14.0) + io-console (0.8.0) + irb (1.15.1) + pp (>= 0.6.0) rdoc (>= 4.0.0) reline (>= 0.4.2) jaro_winkler (1.5.6) @@ -134,8 +135,8 @@ GEM railties (>= 4.2.0) thor (>= 0.14, < 2.0) json (2.9.1) - logger (1.6.1) - loofah (2.22.0) + logger (1.6.5) + loofah (2.24.0) crass (~> 1.0.2) nokogiri (>= 1.12.0) mail (2.8.1) @@ -147,7 +148,7 @@ GEM matrix (0.4.2) memory_profiler (1.0.1) mini_mime (1.1.5) - mini_portile2 (2.8.5) + mini_portile2 (2.8.8) minitest (5.25.1) net-imap (0.4.9.1) date @@ -178,7 +179,11 @@ GEM hashery (~> 2.0) ruby-rc4 ttfunk - psych (5.1.2) + pp (0.6.2) + prettyprint + prettyprint (0.2.0) + psych (5.2.3) + date stringio public_suffix (5.0.4) racc (1.8.1) @@ -191,7 +196,7 @@ GEM rack (< 3) rack-test (2.1.0) rack (>= 1.3) - rackup (1.0.0) + rackup (1.0.1) rack (< 3) webrick rails-dom-testing (2.2.0) @@ -201,9 +206,9 @@ GEM rails-html-sanitizer (1.6.0) loofah (~> 2.21) nokogiri (~> 1.14) - railties (7.2.2.1) - actionpack (= 7.2.2.1) - activesupport (= 7.2.2.1) + railties (8.0.1) + actionpack (= 8.0.1) + activesupport (= 8.0.1) irb (~> 1.13) rackup (>= 1.0.0) rake (>= 12.2) @@ -212,10 +217,10 @@ GEM rainbow (3.1.1) rake (13.2.1) rb-readline (0.5.5) - rdoc (6.7.0) + rdoc (6.12.0) psych (>= 4.0.0) regexp_parser (2.9.0) - reline (0.5.10) + reline (0.6.0) io-console (~> 0.5) rexml (3.4.0) rotp (6.3.0) @@ -261,7 +266,7 @@ GEM scenic (1.7.0) activerecord (>= 4.0.0) railties (>= 4.0.0) - securerandom (0.3.1) + securerandom (0.4.1) simplecov (0.22.0) docile (~> 1.1) simplecov-html (~> 0.11) @@ -280,10 +285,10 @@ GEM actionpack (>= 3.0) activesupport (>= 3.0) sprockets (>= 2.8, < 4.0) - sqlite3 (1.7.1) + sqlite3 (2.5.0) mini_portile2 (~> 2.8.0) stackprof (0.2.26) - stringio (3.1.1) + stringio (3.1.2) svg-graph (2.2.2) thor (1.3.0) timeout (0.4.1) @@ -291,34 +296,35 @@ GEM tzinfo (2.0.6) concurrent-ruby (~> 1.0) unicode-display_width (1.8.0) - useragent (0.16.10) + uri (1.0.2) + useragent (0.16.11) vcr (6.2.0) version_gem (1.1.3) webmock (3.19.1) addressable (>= 2.8.0) crack (>= 0.3.2) hashdiff (>= 0.4.0, < 2.0.0) - webrick (1.8.1) + webrick (1.9.1) xpath (3.2.0) nokogiri (~> 1.8) - zeitwerk (2.6.18) + zeitwerk (2.7.1) PLATFORMS ruby DEPENDENCIES - actionmailbox (~> 7.2) - actionmailer (~> 7.2) - actionpack (~> 7.2) + actionmailbox (~> 8.0) + actionmailer (~> 8.0) + actionpack (~> 8.0) actionpack-page_caching - actiontext (~> 7.2) - actionview (~> 7.2) - activejob (~> 7.2) - activemodel (~> 7.2) - activerecord (~> 7.2) + actiontext (~> 8.0) + actionview (~> 8.0) + activejob (~> 8.0) + activemodel (~> 8.0) + activerecord (~> 8.0) activerecord-typedstore - activestorage (~> 7.2) - activesupport (~> 7.2) + activestorage (~> 8.0) + activesupport (~> 8.0) bcrypt (~> 3.1.2) byebug capybara @@ -338,7 +344,7 @@ DEPENDENCIES pdf-reader rack-attack rack-mini-profiler - railties (~> 7.2) + railties (~> 8.0) rb-readline rotp rqrcode diff --git a/benchmarks/lobsters/config/application.rb b/benchmarks/lobsters/config/application.rb index d6c0fdea..5498cfb0 100644 --- a/benchmarks/lobsters/config/application.rb +++ b/benchmarks/lobsters/config/application.rb @@ -21,7 +21,7 @@ module Lobsters class Application < Rails::Application # Initialize configuration defaults for originally generated Rails version. - config.load_defaults 7.2 + config.load_defaults 8.0 # Please, add to the `ignore` list any other `lib` subdirectories that do # not contain `.rb` files, or that should not be reloaded or eager loaded. diff --git a/benchmarks/lobsters/config/environments/production.rb b/benchmarks/lobsters/config/environments/production.rb index 396ca723..c23e53b0 100644 --- a/benchmarks/lobsters/config/environments/production.rb +++ b/benchmarks/lobsters/config/environments/production.rb @@ -88,7 +88,6 @@ # config.host_authorization = { exclude: ->(request) { request.path == "/up" } } # yjit-bench configurations - config.active_record.sqlite3_production_warning = false config.logger = nil config.secret_key_base = 'in general secret should not be in the git repo but this is a benchmark' # If we want to benchmark with YJIT then it has already been enabled by command line arguments.