Re: Java outperforms C++?
- From: Alex <sdfjkhsdkh@xxxxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 15 Apr 2005 12:15:53 -0400
"$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.
.
- Follow-Ups:
- Re: Java outperforms C++?
- From: Mark Randall
- Re: Java outperforms C++?
- References:
- Java outperforms C++?
- From: benben
- Re: Java outperforms C++?
- From: $Scott
- Re: Java outperforms C++?
- From: Alex
- Re: Java outperforms C++?
- From: $Scott
- Java outperforms C++?
- Prev by Date: Re: How to use initialization list?
- Next by Date: Re: error - type cast
- Previous by thread: Re: Java outperforms C++?
- Next by thread: Re: Java outperforms C++?
- Index(es):
Relevant Pages
|