Interface method calls are slow.

Jeff Sturm jsturm@sigma6.com
Tue Nov 16 20:42:00 GMT 1999


Bryce McKinlay wrote:
> Why are interface calls so expensive compared to other calls in gcj?

Make sure your libgcj is newer than 11/04 or so... there was a nasty bug
in the method cache:

http://sourceware.cygnus.com/ml/java-discuss/1999-q4/msg00244.html

Can you run the code with profiling enabled in libgcj?  The method
counts will reveal the method cache hit ratio.

> It also appears that the private method call is not being inlined. I thought
> that gcj was inlining private methods now?

The DECL_INLINE patches are now in, but they don't seem to help without
also patching gcc/calls.c:

http://sourceware.cygnus.com/ml/java-discuss/1999-q4/msg00147.html

Methods currently can only be inlined if they are declared before they
are used.  Also, inlining (final, static) methods across class
boundaries does not yet seem to work.  Compiling with -Winline will list
candidate methods that could not be inlined.

--
Jeff Sturm
jsturm@sigma6.com


More information about the Java mailing list