This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC 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]

[Bug libgcj/12957] New: JNI Performance Issues


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


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