Skip to content

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

Merged
Xuanwo merged 1 commit intoapache:mainfrom
tisonkun:reduce-jni-calls
May 28, 2023
Merged

feat(bindings/java): save one jni call in the hot path#2353
Xuanwo merged 1 commit intoapache:mainfrom
tisonkun:reduce-jni-calls

Conversation

@tisonkun
Copy link
Copy Markdown
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.

Signed-off-by: tison <wander4096@gmail.com>
Copy link
Copy Markdown
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