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() ?


Tom Tromey wrote:

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



Fixing the stack frame stuff would significantly improve JNI performance, IMO. At the moment, I suspect the cost of the method lookup is insignificant compared to the overhead of the frame creation.


By my (casual) measurements, our JNI is on the order of 10X slower than the JRE for Java->C calls. There's a test case in bugzilla:

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12957

But you're right, maybe we should oprofile it to be sure.

Regards

Bryce.


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