summaryrefslogtreecommitdiffstats
path: root/config
diff options
context:
space:
mode:
authorMatt Jankowski <matt@jankowski.online>2024-05-16 05:56:48 -0400
committerGitHub <noreply@github.com>2024-05-16 09:56:48 +0000
commit1b6eb2c7f0425a20f9bd823419138bf8adfa18f4 (patch)
tree08b3d7aa78917b59c0ac0d7aa885aaf2120c965b /config
parent283a891e9290fc9fdbfd082f3bde48863f1c6f45 (diff)
Enable YJIT when available (#30310)
Diffstat (limited to 'config')
-rw-r--r--config/initializers/enable_yjit.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/config/initializers/enable_yjit.rb b/config/initializers/enable_yjit.rb
new file mode 100644
index 00000000000..7b1053ec114
--- /dev/null
+++ b/config/initializers/enable_yjit.rb
@@ -0,0 +1,13 @@
+# frozen_string_literal: true
+
+# Automatically enable YJIT as of Ruby 3.3, as it brings very
+# sizeable performance improvements.
+
+# 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