This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Fibonacci and performance


>>>>> "Tony" == Tony Kimball <alk@pobox.com> writes:

Tony> When I made the fib(x) method not to be static any more,
Tony> the time was cut roughly in half:

Ok.  But when I compare the non-static Fib.java against fib.cc I still
see a difference:

    creche. ./Fx ; echo ; ./Fj
    102334155
    Fibonacci: n = 40 took 15789 ms

    102334155
    Fibonacci: n = 40 took 21070 ms

In this case the gcj assembly output looks very different from the g++
output (before the change it was very similar).  For one thing the
assembly (both at -O2) for the function in question is almost twice as
long for gcj.

Tom


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]