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

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
Copy link
Member

kares commented Sep 5, 2017

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

@headius
Copy link
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
@original-brownbear original-brownbear deleted the smaller-bytecode-javainterface-impl branch September 5, 2017 15:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants