Skip to content

Commit

Permalink
Enable YJIT for Ruby
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
p8 committed Sep 5, 2024
1 parent c5753ee commit f3cbdd2
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions ruby/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
2 changes: 2 additions & 0 deletions ruby/rails-api/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 2 additions & 0 deletions ruby/rails/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit f3cbdd2

Please sign in to comment.