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 jni library setup and logging #113

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Larusso
Copy link
Member

@Larusso Larusso commented Nov 19, 2021

Descritption

This is a test to see if I can improve the logging setup of the JNI library. I would also like to adjust the rust sources and mixxed this into this one patch. The main problem is the caching of the class references which I need to do in an unsafe manner. The idea is to have a jni_cache module which loads the method/class/field references at loadtime of the shared libary. This should improve the performance.

It also sets up a custom log writer which sends all messages to a logger on the Java side. I need to measure what this would mean in real world usage since the bottleneck here is JNI. I allready cache the created logger obj as a global reference, Means it should not get garbage collected between JNI calls.

Changes

  • IMPROVE crate layout
  • ADD jni global method/class cache
  • ADD custom log writer to send logs from rust to java

Descritption
============

This is a test to see if I can improve the logging
setup of the JNI library. I would also like to adjust
the rust sources and mixxed this into this one patch.
The main problem is the caching of the class references which I
need to do in an `unsafe` manner. The idea is to have a
`jni_cache` module which loads the method/class/field references at
loadtime of the shared libary. This should improve the performance.

It also sets up a custom log writer which sends all messages to
a logger on the Java side. I need to measure what this would mean in
real world usage since the bottleneck here is JNI. I allready cache
the created logger obj as a global reference, Means it should not get
garbage collected between JNI calls.

Changes
=======

* ![IMPROVE] crate layout
* ![ADD] `jni` global method/class cache
* ![ADD] custom log writer to send logs from rust to java
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.

1 participant