public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libgcj/12957] New: JNI Performance Issues
@ 2003-11-08  2:04 bryce at mckinlay dot net dot nz
  2003-11-08  2:27 ` [Bug libgcj/12957] " bryce at mckinlay dot net dot nz
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: bryce at mckinlay dot net dot nz @ 2003-11-08  2:04 UTC (permalink / raw)
  To: gcc-bugs

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug libgcj/12957] JNI Performance Issues
  2003-11-08  2:04 [Bug libgcj/12957] New: JNI Performance Issues bryce at mckinlay dot net dot nz
@ 2003-11-08  2:27 ` bryce at mckinlay dot net dot nz
  2003-11-08  2:34 ` [Bug java/12957] " bryce at mckinlay dot net dot nz
  2004-04-20  1:09 ` bryce at mckinlay dot net dot nz
  2 siblings, 0 replies; 4+ messages in thread
From: bryce at mckinlay dot net dot nz @ 2003-11-08  2:27 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From bryce at mckinlay dot net dot nz  2003-11-08 02:27 -------
Created an attachment (id=5097)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=5097&action=view)
Call timing benchmark


-- 


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


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug java/12957] JNI Performance Issues
  2003-11-08  2:04 [Bug libgcj/12957] New: JNI Performance Issues bryce at mckinlay dot net dot nz
  2003-11-08  2:27 ` [Bug libgcj/12957] " bryce at mckinlay dot net dot nz
@ 2003-11-08  2:34 ` bryce at mckinlay dot net dot nz
  2004-04-20  1:09 ` bryce at mckinlay dot net dot nz
  2 siblings, 0 replies; 4+ messages in thread
From: bryce at mckinlay dot net dot nz @ 2003-11-08  2:34 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
          Component|libgcj                      |java
     Ever Confirmed|                            |1
   Last reconfirmed|0000-00-00 00:00:00         |2003-11-08 02:34:13
               date|                            |


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


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug java/12957] JNI Performance Issues
  2003-11-08  2:04 [Bug libgcj/12957] New: JNI Performance Issues bryce at mckinlay dot net dot nz
  2003-11-08  2:27 ` [Bug libgcj/12957] " bryce at mckinlay dot net dot nz
  2003-11-08  2:34 ` [Bug java/12957] " bryce at mckinlay dot net dot nz
@ 2004-04-20  1:09 ` bryce at mckinlay dot net dot nz
  2 siblings, 0 replies; 4+ messages in thread
From: bryce at mckinlay dot net dot nz @ 2004-04-20  1:09 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From bryce at mckinlay dot net dot nz  2004-04-19 23:52 -------
Profiling:

$ ./invbench
native:          2705ms [541ns / call]
10000002
qprof: /home/mckinlay/invbench/invbench: 260 samples, 260 counts
libpthread.so.0(pthread_getspecific)                             1      (  0%)
libc.so.6                                                        1      (  0%)
libc.so.6(malloc)                                                33     ( 13%)
libc.so.6(__libc_free)                                           68     ( 26%)
libNativeJNI.so(Java_Native_a)                                   3      (  1%)
libgcj.so.6                                                      2      (  1%)
libgcj.so.6(_Z19_Jv_MallocUncheckedi)                            2      (  1%)
libgcj.so.6(_Jv_Free)                                            1      (  0%)
libgcj.so.6(_Jv_GetJNIEnvNewFrame)                               136    ( 52%)
libgcj.so.6(_Jv_JNI_PopSystemFrame)                              3      (  1%)
libgcj.so.6(_Z20_Jv_GetCurrentJNIEnvv)                           4      (  2%)
invbench(_Jv_JNI_PopSystemFrame)                                 2      (  1%)
Native::a()                                                      3      (  1%)
Bench::Bench()                                                   1      (  0%)


-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|2004-04-06 02:31:10         |2004-04-19 23:52:26
               date|                            |


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


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2004-04-19 23:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-11-08  2:04 [Bug libgcj/12957] New: JNI Performance Issues bryce at mckinlay dot net dot nz
2003-11-08  2:27 ` [Bug libgcj/12957] " bryce at mckinlay dot net dot nz
2003-11-08  2:34 ` [Bug java/12957] " bryce at mckinlay dot net dot nz
2004-04-20  1:09 ` bryce at mckinlay dot net dot nz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).