very slow jni code callbacks

Herman ten Brugge hermantenbrugge@home.nl
Sun Sep 27 13:23:00 GMT 2009


I have a problem with jni code callbacks.
I have attached some code that shows the problem.
The result of this code is:

# results on fedora 11
#  gcc/gcj 4.4.1
#  kernel 2.6.30.5-43.fc11.x86_64
#  openjdk fedora-29.b16.fc11-x86_64
#
#                       open jdk        gcj
# no_jni                 1.48               7.46        (  5 times slower)
# jni                   66.70           17140.00        (257 times slower)

So when not using jni in this case gcj is 5 times slower.
I suspect the jit compiler does a good for this small sample.

The code with jni calls is however 257 timer slower. I really
did not expect that. I also tried other java vm and they all
have much better performance. So I expect a problem in the
gcj library.

When I use oprofile I see at lot of calls to execute_cfa_program
and _Unwind_IteratePhdrCallback.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tst.tar
Type: application/x-tar
Size: 20480 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/java/attachments/20090927/2440bf7b/attachment.tar>


More information about the Java mailing list