class initialization check overhead

Jeff Sturm jsturm@one-point.com
Thu Oct 24 21:06:00 GMT 2002


On Thu, 24 Oct 2002, Kresten Krab Thorup wrote:
>     if (!_initialized_org_gnu_foo_MyClass) {
>        _Jv_InitClass(&_gnu_foo_MyClass, &_init_gnu_foo_MyClass;);
>     }

Sure.  It would improve on the current init check.  But even
this adds quite a bit of complexity to small static methods (e.g.
leaf functions).

I did some experiments to see how small and fast a gcj-compiled
application could be.  With a modified generational GC, whole-program
inlining and other performance hacks it runs my tests about as fast as
Hotspot.  Though it is considerably smaller in runtime footprint (when
built statically).

> It seems to me that this would be more portable than using traps.

Certainly.  It might turn out that my idea doesn't help much at all
anyway.  I still think it would be an interesting experiment however.

Jeff



More information about the Java mailing list