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

Improve generated interface impls #251

Open
headius opened this issue Jun 14, 2021 · 1 comment
Open

Improve generated interface impls #251

headius opened this issue Jun 14, 2021 · 1 comment

Comments

@headius
Copy link
Member

headius commented Jun 14, 2021

We should have a look at how we are generating the implementations of users' interfaces and see if we can make improvements, based on newer ASM and JDK features:

  • Reduce the cost of generating and loading the code.
  • Improve the performance of dispatch through the generated code.

This code was originally written by Wayne Meissner many years ago, so there should be some good improvements possible.

Note that #249 was discovered because JRuby's faster-starting "dev mode" disables the ASM-based code generation in jnr-ffi, which does have a measurable impact on startup time.

@headius
Copy link
Member Author

headius commented Jun 29, 2021

Mostly this needs an audit to see what could be improved, as the code is very old.

I added this as a placeholder because we were debating whether to turn the generation off for the --dev flag, which does have a small but measurable impact on startup. Ideally we would not ever turn it off because the non-generated path uses java.lang.Proxy which has perf and behavior problems.

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

No branches or pull requests

1 participant