Ruby 3.2 with YJIT

After Ruby 3.2.0 build fails was resolved we can use Ruby 3.2, but it is currently not compiled with YJIT:

$ ruby -v --yjit
ruby: warning: Ruby was built without YJIT support. You may need to install rustc to build Ruby with YJIT.
ruby 3.2.0 (2022-12-25 revision a528908271) [x86_64-linux]

YJIT in Ruby 3.2 provides significant speedups (20-40%) for Rails and other Ruby applications. Rust 1.58+ is required per ruby/building_ruby.md at v3_2_0 · ruby/ruby · GitHub. FWIW, on my Mac installing Rust with Homebrew was enough for ruby-install 3.2.0 to pick it up automatically.

After Ruby is built with YJIT one still needs to activate it either via command line option (ruby --yjit) or environment variable (RUBY_YJIT_ENABLE=1 ruby). I believe this opt-in makes it safe for Render to distribute a YJIT-enabled Ruby 3.2 in the Ruby language Native Environment, and we’d love to take advantage of it :pray:

We’ve just uploaded a build with YJIT enabled. Try it out!

ruby 3.2.0 (2022-12-25 revision a528908271) +YJIT [x86_64-linux]

Confirmed after a fresh deploy. That was fast, thanks!

Hi Bart. I’m curious if you guys have had any issues on 3.2. I updated to 3.2 shortly after Render made it available in late December but then my background worker started crashing. There was no stack trace & I couldn’t figure out what was going on. So I reverted back to 3.1 & all is running smoothly again. I’m thinking I’ll just keep trying every few weeks as underlying gems get updated and/or a Ruby patch comes out.

Smooth sailing for us so far.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.