timob / jnigi

Golang Java JNI library
BSD 2-Clause "Simplified" License
163 stars 44 forks source link

JNI ID caching #80

Open timob opened 9 months ago

timob commented 9 months ago

Currently we cache class IDs (uintptr) so they don't need to be found using the findClass JNI function.

But not method IDs which we call getMethodID for in each CallMethod. The same is true for field IDs. We could start caching these two types of IDs too.

We currently create global references to class IDs (which are objects), so method and field IDs should remain valid while we hold this global reference.