This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: Fibonacci and performance
- To: tromey at redhat dot com
- Subject: Re: Fibonacci and performance
- From: Per Bothner <per at bothner dot com>
- Date: 27 Apr 2001 09:07:21 -0700
- Cc: Java Discuss List <java at gcc dot gnu dot org>
- References: <874rval8r6.fsf@creche.redhat.com>
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/