This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: JNI without Jni_Lookup() ?


>>>>> "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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]