r/ruby • • Dec 25 '22

Ruby 3.2.0 Released

https://www.ruby-lang.org/en/news/2022/12/25/ruby-3-2-0-released/
234 Upvotes

26 comments sorted by

View all comments

7

u/jrochkind Dec 25 '22

I would love to hear more about YJIT. Who's using it in production? Should you expect increased RAM consumption, about how much?

3

u/schneems Puma maintainer Dec 26 '22

Heroku compiled 3.2 with yjit support for anyone who wants to play with it in prod

1

u/brittballard Dec 30 '22

Is it enabled by default?

3

u/schneems Puma maintainer Dec 31 '22

You have to enable it with a flag or RUBYOPT env vars

heroku config:set RUBYOPT=’--enable-yjit’

2

u/brittballard Jan 01 '23

Thank you, old friend. I hope you're doing well!

1

u/yeskia Oct 19 '23

Is there a difference between `--yjit` and `--enable-yjit`? `--enable-yjit` doesn't appear in the list when I run `ruby -h`

2

u/schneems Puma maintainer Oct 19 '23

I see it running locally and on Heroku:

$ ruby -v
ruby 3.2.2 (2023-03-30 revision e51014f9c0) [x86_64-darwin22]
$ ruby -h | grep jit
  --jit           enable JIT for the platform, same as --yjit
  --mjit          enable C compiler-based JIT compiler (experimental)
  --yjit          enable in-process JIT compiler

To have it available your system needs rust when it compiles. Make sure you're using Ruby 3.2 and make sure rust is installed. Try uninstalling and reinstalling ruby. I use chruby + ruby-install.

1

u/yeskia Oct 19 '23

Whoa, appreciate the fast response!

Yeah - I see --yjit locally - I'm just not sure where `--enable-yjit` comes from or if there is a difference between the two. Does RUBYOPT need to be set to --enable-yjit or is just --yjit enough?

1

u/schneems Puma maintainer Oct 19 '23

The “enable” and “disable” are basically config variants of RUBYOPT https://stackoverflow.com/questions/59616020/what-are-the-options-for-rubyopt-env#59616442