Skip to content


Inline policy method size values #1947

hosiawak opened this Issue · 5 comments

3 participants

Rubinius member

I noticed that there are some hardcoded values in vm/llvm/inline_policy.hpp
that describe what JIT considers small, normal and large method size. The values
at the moment are 100, 300 and 2000 respectively.

Similarly to what we've done in #1426 I think it's worth considering the following:

  1. Enabling configuration of these variables via -Xjit.
  2. Bumping the default values. I don't have a fine tuned value for each but changing

100 to 300
300 to 1000
2000 to 3000

cuts the CI run time by 20% on my machine.

Rubinius member

The values I pasted above are also random btw, I'll see if I can find better default by running and benchmarking some real code.

Rubinius member

Ah awesome, would love to have some numbers that at least based on running code instead of our own guesses ;).

Rubinius member

@hosiawak any chance you could run this on perhaps a Rails app? Running RubySpec is not a great test of the JIT since the vast majority of code executes once. The biggest part of RubySpec that is running is a big loop. So you've probably succeeded in making that inline.

Rubinius member

@brixen, true. I tested different values on some of my rails apps and didn't see much speed difference or it was negative. It might be that the current values are not bad actually, I'll play with it more when I get a moment.

Do you think these thresholds should be configurable with -Xjit.inline.{small,normal,large)_method_size (or something along these lines) anyway ?

Rubinius member

@hosiawak making them configurable sounds terrific!

@dbussink dbussink closed this in 9ae294b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.