From: "georgeclaghorn (George Claghorn)" Date: 2021-12-27T22:15:56+00:00 Subject: [ruby-core:106853] [Ruby master Bug#18440] YJIT is enabled if any YJIT tuning options are set Issue #18440 has been updated by georgeclaghorn (George Claghorn). From [the code](https://github.com/ruby/ruby/blob/2c7aed46ba886c6fc4fb15e404035755f9884d54/ruby.c#L1545), this appears to be intentional. [`setup_yjit_options`](https://github.com/ruby/ruby/blob/2c7aed46ba886c6fc4fb15e404035755f9884d54/ruby.c#L1086) returns `true` if any of the `--yjit-*` options are provided: ```c else if (strcmp("yjit", s) == 0 || setup_yjit_options(s, &opt->yjit)) { #if USE_MJIT FEATURE_SET(opt->features, FEATURE_BIT(yjit)); #else rb_warn("Ruby was built without JIT support"); #endif } ``` ---------------------------------------- Bug #18440: YJIT is enabled if any YJIT tuning options are set https://bugs.ruby-lang.org/issues/18440#change-95664 * Author: georgeclaghorn (George Claghorn) * Status: Open * Priority: Normal * ruby -v: ruby 3.1.0p0 (2021-12-25 revision fb4df44d16) [arm64-darwin21] * Backport: 2.6: UNKNOWN, 2.7: UNKNOWN, 3.0: UNKNOWN, 3.1: UNKNOWN ---------------------------------------- I was testing YJIT in a Rails app with `RUBYOPT="--yjit --yjit-exec-mem-size=32"`. I saw some weird issues around Rails view caching, so I attempted to temporarily disable YJIT by removing `--yjit` and leaving the tuning options in place (`RUBYOPT="--yjit-exec-mem-size=32"`). However, YJIT remained enabled until I also removed `--yjit-exec-mem-size=32`. ``` $ ruby -e 'puts RubyVM::YJIT.runtime_stats.inspect' nil $ ruby --yjit-exec-mem-size -e 'puts RubyVM::YJIT.runtime_stats.inspect' {:inline_code_size=>378495, :outlined_code_size=>311079} ``` I expected removing `--yjit` to disable YJIT and was surprised by this. -- https://bugs.ruby-lang.org/ Unsubscribe: