Fibonacci and performance
Per Bothner
per@bothner.com
Fri Apr 27 09:03:00 GMT 2001
Tom Tromey <tromey@redhat.com> writes:
> Looking at the generated assembly, the only real difference I see is
> the call to _Jv_InitClass in Fib.fib(). In this particular case we're
> paying a pretty big penalty.
>> I wonder if inlining the "already initialized" check from
> _Jv_InitClass would help or hurt (due to increased code size).
The only class I can see that needs to be initialized in Fib.fib is
Fib itself, but that has already been initialized - since we're
executing Fib code. Don't we test for this situation? If not, it
shouldn't be difficult to add. Basically, drop calls to _Jv_InitClass
if the class being initiazed is the current class or one of its
super-classes.
Or am I misunderstanding something?
--
--Per Bothner
per@bothner.com http://www.bothner.com/~per/
More information about the Java
mailing list