Skip to content

Commit

Permalink
Add initializer for YJIT
Browse files Browse the repository at this point in the history
  • Loading branch information
rossta committed Dec 26, 2023
1 parent 582c367 commit 10a1244
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions config/initializers/yjit.rb
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 10a1244

Please sign in to comment.