From f3cbdd21102e0c0f9d101f689bcc816b093b40d2 Mon Sep 17 00:00:00 2001 From: Petrik de Heus Date: Thu, 5 Sep 2024 17:58:19 +0200 Subject: [PATCH] Enable YJIT for Ruby Rails 7.2 enables YJIT itself after initialization. This makes sure code that only runs on initializing is not jitted. So for Rails we set RUBY_YJIT_ENABLE to falsey. --- ruby/config.yaml | 1 + ruby/rails-api/config.yaml | 2 ++ ruby/rails/config.yaml | 2 ++ 3 files changed, 5 insertions(+) diff --git a/ruby/config.yaml b/ruby/config.yaml index 763007a2392..0f26c9662e1 100644 --- a/ruby/config.yaml +++ b/ruby/config.yaml @@ -33,6 +33,7 @@ framework: - config.ru environment: + RUBY_YJIT_ENABLE: 1 RACK_ENV: production BUNDLE_WITHOUT: "development,test" SECRET_KEY_BASE: Awe$ome_Secret. diff --git a/ruby/rails-api/config.yaml b/ruby/rails-api/config.yaml index daaddca4daa..81638358593 100644 --- a/ruby/rails-api/config.yaml +++ b/ruby/rails-api/config.yaml @@ -8,3 +8,5 @@ framework: environment: RAILS_ENV: production RAILS_LOG_LEVEL: fatal + # Rails enables YJIT after the app has initialized + RUBY_YJIT_ENABLE: 0 diff --git a/ruby/rails/config.yaml b/ruby/rails/config.yaml index daaddca4daa..81638358593 100644 --- a/ruby/rails/config.yaml +++ b/ruby/rails/config.yaml @@ -8,3 +8,5 @@ framework: environment: RAILS_ENV: production RAILS_LOG_LEVEL: fatal + # Rails enables YJIT after the app has initialized + RUBY_YJIT_ENABLE: 0