This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libgcj/12957] New: JNI Performance Issues
- From: "bryce at mckinlay dot net dot nz" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 8 Nov 2003 02:04:24 -0000
- Subject: [Bug libgcj/12957] New: JNI Performance Issues
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
JNI native calls are substantially (~10x) slower under GCJ compared with the Sun JRE. Improving
JNI performance should benefit AWT and SWT significantly.
With Sun's JRE 1.4.2-beta:
[bryce@hokkaido invbench]$ java Bench
...
native: 317ms [63ns / call]
With GCJ 3.4 20031104:
[bryce@hokkaido invbench]$ ./invbench
...
native: 3193ms [638ns / call]
One obvious problem is that we allocate during every JNI call, in _Jv_GetJNIEnvNewFrame(). This
could be stack allocated in the stub's frame.
Other ideas for speeding it up: Use the new thread-local storage support to cache the thread's
JNIEnv, and avoid the call to get it in the common case. Also, we may be able to inline the common
cases of _Jv_JNI_PopLocalFrame.
--
Summary: JNI Performance Issues
Product: gcc
Version: 3.4
Status: UNCONFIRMED
Severity: enhancement
Priority: P2
Component: libgcj
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: bryce at mckinlay dot net dot nz
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12957