Project

General

Profile

Feature #14878

Add command line argument to deactivate JIT

Added by noahgibbs (Noah Gibbs) 20 days ago. Updated about 11 hours ago.

Status:
Closed
Priority:
Normal
Target version:
[ruby-core:87671]

Description

For Ruby 2.6, JIT is off by default. But if a particular application can't use JIT for some reason, it may want to explicitly turn JIT off, even for later Ruby versions that have JIT on by default.

It would be useful to have a --jit-disable command line option to turn JIT off explicitly for later Ruby versions. This option should do nothing in Ruby 2.6.

Why turn JIT off? Some possible reasons:

  • benchmarking
  • no compiler installed
  • known compiler/library bug in non-Ruby system software
  • short program run-time so JIT won't help
  • very tight memory constraints, don't want to start a compiler process
  • read-only file system so you can't write .c files

I'm not married to the name "--jit-disable". I'd be fine with "--no-jit" or "--disable=jit", etc. But there should be an option to disable JIT in future Ruby versions.

Associated revisions

Revision 053cdaf7
Added by k0kubun (Takashi Kokubun) about 11 hours ago

ruby.c: accept --disable-jit option

by promoting jit to feature flag.

mjit.h: update comment about mjit_opts.on

test_rubyoptions.rb: add test for switching JIT enablement

"--jit" flag usage may be deprecated later, but not discussed yet.

[Feature #14878]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63995 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 63995
Added by k0kubun (Takashi Kokubun) about 11 hours ago

ruby.c: accept --disable-jit option

by promoting jit to feature flag.

mjit.h: update comment about mjit_opts.on

test_rubyoptions.rb: add test for switching JIT enablement

"--jit" flag usage may be deprecated later, but not discussed yet.

[Feature #14878]

History

#1 [ruby-core:87668] Updated by shevegen (Robert A. Heiler) 20 days ago

Agreed!

I guess it may have already been on Takashi's todo list but he is like doing
lots of changes as-is.

As for options, I think "--disable-jit" and/or "--no-jit" would be best;
--disable=jit is also ok but a bit less commonly used compared to options
without a '='.

The flag "--jit-disable" is a bit weird because I think it is not very common
to have the verb come last (e.g. --FEATURE--enable or --FEATURE--disable) but
I think these are details, not the big picture.

And on the suggestion itself to be able to have control over the jit, I
fully agree. I would even enable both compilation support for jit (yes/no)
and also on the commandline (yes/no). I myself would want to run with jit
on all the time, but as described, there may be many reasons why some
people may not want to or can not use mjit, so in these cases, I think
it makes sense to have it optional (or "controllable" by the ruby hacker
at hand), so

+1

#2 [ruby-core:87985] Updated by akr (Akira Tanaka) about 17 hours ago

There is already --enable=... and --disable=...

% ruby --help
...
  --enable={gems|rubyopt|...}[,...], --disable={gems|rubyopt|...}[,...]
                  enable or disable features. see below for available features
...

I think there is no reason to use different style for this issue.

#3 Updated by k0kubun (Takashi Kokubun) about 11 hours ago

  • Status changed from Open to Closed

Applied in changeset trunk|r63995.


ruby.c: accept --disable-jit option

by promoting jit to feature flag.

mjit.h: update comment about mjit_opts.on

test_rubyoptions.rb: add test for switching JIT enablement

"--jit" flag usage may be deprecated later, but not discussed yet.

[Feature #14878]

#4 [ruby-core:87990] Updated by k0kubun (Takashi Kokubun) about 11 hours ago

Now --enable-jit, --enable=jit, --disable-jit, --disable=jit are available.

Also available in: Atom PDF