Improve jni library setup and logging #113
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 ajni_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
jni
global method/class cache