From c82a5897d7bf4a5663083362f24282cb8f0c3ea5 Mon Sep 17 00:00:00 2001 From: Andrew Tomaka Date: Fri, 2 Aug 2024 20:03:06 -0400 Subject: [PATCH] Add initializer for yjit from Rails 8 (#24) Reviewed-on: https://git.atomaka.com/atomaka/budget/pulls/24 --- config/initializers/yjit.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 config/initializers/yjit.rb diff --git a/config/initializers/yjit.rb b/config/initializers/yjit.rb new file mode 100644 index 0000000..892911e --- /dev/null +++ b/config/initializers/yjit.rb @@ -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