Re: Java outperforms C++?

Tech-Archive recommends: Fix windows errors by optimizing your registry



"$Scott" <$Scott@xxxxxxxxxxxxxxxxxx> wrote in
news:d3n7t1$rfq$1$8300dec7@xxxxxxxxxxxxxxxx:

> If you want to test efficiency at handling
> function calls, don't replace the calls with an iterative loop, it
> rather defeats the whole purpose of the test.
There is a method call test for this purpose
http://kano.net/javabench/src/cpp/methcall.cpp
which actually resembles some real scenario instead of doing nested
calls one million deep like Fibonacci and Ackermann.

Results of this test look surprising to me. I've run original test and
got 12.5s. Then I've inlined the functions and it went down to 7.8s.
That's about what is expected. But Java was almost 10 times faster! So
I've completely removed function calls and put the code right in the
loop, but the time still stayed at 7.8s. I have no explanation for
that, unless Java optimizer somehow manages to figure out the end
result without actually running the loop...

Alex.
.



Relevant Pages

  • Re: acceptance of forth
    ... I think it's a matter of focus. ... In retrospect, you might have saved some time by learning on a friendlier system until you got the basics down, and then seeing how they apply in OF. ... can too easily be assumed to be the main purpose of the loop. ...
    (comp.lang.forth)
  • Re: change value and concatenate
    ... The purpose of the for loop is to shift down all the fields so that, ... shifted down by two sonce $4 and $5 have been unified. ...
    (comp.lang.awk)
  • Re: Parentheses
    ... > One proviso here. ... I always feel very uncomfortable about explicitly assigning ... its purpose, though, perverse as it was. ... ...has the same effect as printing from inside the loop. ...
    (perl.beginners)
  • Re: Honda 1980 Civic Fuel Tank Connections
    ... This fuel hose arrangement appears to be unique to second-generation ... I'm also baffled as to the purpose of that loop. ... The gasoline vapour condenses back to liquid ...
    (rec.autos.tech)
  • Re: Java outperforms C++?
    ... >> rather defeats the whole purpose of the test. ... But Java was almost 10 times faster! ... > loop, but the time still stayed at 7.8s. ... unless Java optimizer somehow manages to figure out the end ...
    (microsoft.public.vc.language)