This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: Fibonacci and performance
Tom Tromey <tromey@redhat.com> writes:
> Nope, Fib.fib is initializing the Fib class over and over. I don't
> know if we test for this situation or not, but I assume not. I guess
> this would only affect recursive calls.
What I forgot was that we do the Jv_InitClass at the start of the
called method, not at the call site. This saves code space, but
it makes it harder to optimize the call away when it is unneeded.
We might re-consider this decision if/when we get smarter about
initialization.
--
--Per Bothner
per@bothner.com http://www.bothner.com/~per/