Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate smaller bytecode when using Ruby type on implemented Java Interface + Benchmark #4777

Merged

Conversation

@original-brownbear
Copy link
Contributor

@original-brownbear original-brownbear commented Sep 5, 2017

It seems when compiling Ruby implementations of Java interfaces, we were generating bytecode that runs any non-primitive type through convertJavaToUsableRubyObject.
This seems unnecessary to me if we know that we're dealing with an IRubyObject type of argument => we can save that call and the loading of the Ruby runtime argument, right?

I included the benchmark I used to verify that this comes with a positive performance impact (for me it showed about a 5% speed-up).

…nterface + Benchmark
@kares
Copy link
Member

@kares kares commented Sep 5, 2017

totally makes sense - thanks for digging throught these bits, there's probably a lot of 💎 to be found :)

@kares kares added this to the JRuby 9.2.0.0 milestone Sep 5, 2017
@headius
Copy link
Member

@headius headius commented Sep 5, 2017

👍 looks good. There's a lot of gems hidden in interface impl and concrete subclass logic:

  • Use indy to optimize method lookups, dispatch, and type conversion
  • Move more logic to utility methods

This is a good start :-)

@headius headius merged commit 6e9854f into jruby:master Sep 5, 2017
1 check failed
1 check failed
continuous-integration/travis-ci/pr The Travis CI build failed
Details
@original-brownbear original-brownbear deleted the original-brownbear:smaller-bytecode-javainterface-impl branch Sep 5, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.