JNI without Jni_Lookup() ?
Tom Tromey
tromey@redhat.com
Mon Apr 19 17:26:00 GMT 2004
>>>>> "Erik" == Erik Poupaert <erik.poupaert@skynet.be> writes:
Erik> At present JNI has a performance disadvantage compared to CNI,
Erik> because JNI methods need to get looked up in hashtables, while
Erik> CNI can be linked statically.
This cost is pretty small, actually. We cache the results of the JNI
lookup, so that is only done once.
We do have an expensive way of making JNI stack frames. It would be
worthwhile to profile this code and seeing if improving it would make
sense.
And JNI code in general is expensive since even things like a field
lookup require at least one function call (two if you don't cache
field IDs).
We can't directly put a pointer to a user's JNI function into a
vtable, because JNI use a different calling convention. In particular
there is an extra argument for the JNI environment (static methods
also have an extra argument).
Tom
More information about the Java
mailing list