Skip to content

Commit af73d4e

Browse files
committed
Support hash options for YJIT configuration
1 parent bf80199 commit af73d4e

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

guides/source/configuring.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -641,6 +641,7 @@ See [Custom Configuration](#custom-configuration)
641641

642642
Enables YJIT as of Ruby 3.3, to bring sizeable performance improvements. If you are
643643
deploying to a memory constrained environment you may want to set this to `false`.
644+
Additionally, you can pass a hash to configure YJIT options such as `{ stats: true }`.
644645

645646
| Starting with version | The default value is |
646647
| --------------------- | -------------------- |

railties/lib/rails/application/finisher.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,8 @@ def self.complete(_state)
229229

230230
initializer :enable_yjit do
231231
if config.yjit && defined?(RubyVM::YJIT.enable)
232-
RubyVM::YJIT.enable
232+
options = config.yjit.is_a?(Hash) ? config.yjit : {}
233+
RubyVM::YJIT.enable(**options)
233234
end
234235
end
235236
end

0 commit comments

Comments
 (0)