Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@headius
Copy link
Member

@headius headius commented Nov 5, 2019

This avoids bouncing through the metaClass to get the runtime,
which happens in these methods and in several downstream calls.
Several cases also needed the context, so this saves the extra
overhead of traversing the runtime, thread service, and thread
local to get the context.

This is a PR to get input. Some signatures change without a class-local replacement, so code compiled to those signatures on those classes would fail. I didn't want to leave deprecated no-arg versions all over the place.

There are also many other core IRubyObject methods that don't accept context.

I have not done any perf measurements but it's probably negligible. The main benefit is that the context will almost always be in cache for a given thread, since we pass it through almost all call paths.

This avoids bouncing through the metaClass to get the runtime,
which happens in these methods and in several downstream calls.
Several cases also needed the context, so this saves the extra
overhead of traversing the runtime, thread service, and thread
local to get the context.
Most of these cases were improperly saving the context at the
point of contructing the size function.
@headius headius added this to the JRuby 9.2.10.0 milestone Nov 7, 2019
@headius headius merged commit 74c6702 into jruby:master Nov 7, 2019
@headius headius deleted the to_a_context branch November 7, 2019 22:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant