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
merged 1 commit into from Sep 5, 2017

Conversation

Projects
None yet
3 participants
@original-brownbear
Contributor

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).

@kares

This comment has been minimized.

Member

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

This comment has been minimized.

Member

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

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