Add initializer for yjit from Rails 8
All checks were successful
Ruby CI / test (pull_request) Successful in 33s
All checks were successful
Ruby CI / test (pull_request) Successful in 33s
This commit is contained in:
parent
b8d928f4ea
commit
89d6ea23aa
1 changed files with 12 additions and 0 deletions
12
config/initializers/yjit.rb
Normal file
12
config/initializers/yjit.rb
Normal file
|
@ -0,0 +1,12 @@
|
|||
# Automatically enable YJIT if running Ruby 3.3 or newer,
|
||||
# as it brings very sizeable performance improvements.
|
||||
# Many users reported 15-25% improved latency.
|
||||
|
||||
# If you are deploying to a memory-constrained environment,
|
||||
# you may want to delete this file, but otherwise, it's free
|
||||
# performance.
|
||||
if defined? RubyVM::YJIT.enable
|
||||
Rails.application.config.after_initialize do
|
||||
RubyVM::YJIT.enable
|
||||
end
|
||||
end
|
Loading…
Reference in a new issue