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

feat(bindings/java): save one jni call in the hot path #2353

Merged
merged 1 commit into from
May 28, 2023

Conversation

tisonkun
Copy link
Member

This may not be necessary within single language scope since we can trust the compiler or JIT to inline code as much as possible.

But it's valuable when calls cross language boundaries since no optimization can happen here. Also, obtaining a future and getting it to complete is the hot path for all async ops. Thus I believe it is worth trading off some code style (static method over singleton and then call member method) for efficiency.

Copy link
Member

@Xuanwo Xuanwo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@Xuanwo Xuanwo merged commit 2d4c144 into apache:main May 28, 2023
@tisonkun tisonkun deleted the reduce-jni-calls branch May 28, 2023 16:00
@Xuanwo Xuanwo mentioned this pull request May 30, 2023
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.

2 participants