speed of simple loops: comparison to other language
Steve White
swhite at aip.de
Thu Jul 1 05:22:45 PDT 2010
Hi, John!
Thanks for your input!
I think you may have misjudged my intent however.
And I don't think this issue should be quickly dismissed.
On 30.06.10, John Pampuch wrote:
>
> If you are using the same code generation (see further down), this may be
> a combination of the reduced number of registers available in 32 bit mode,
> combined with some anomaly of the benchmarks that allow Java to fit
> critical fields more fully into registers in the 64 bit mode.
What anomoly would that be?
As you can see, the test code is deliberately extremely simple.
> This is flaw in micro benchmarks: it is easy to find a simple case which
> performs comparatively poorly for either Java or C/C++; you just need to
> know a bit about how the underlying technology works.
>
I did not set out to show Java to be slow. Rather the opposite.
This is precisely why I tried several different common tests.
But the results were across-the-board.
On IA36 machines, using distribution VMs, simple iterated arithmetic is
generally several times slower in current Java VMs than similar code in C.
As to knowing the underlying technology: I am personally interested, yes.
But for the daily compiler user, they *should not* concern themselves with
such issues. Precisely the purpose of the optimizer is to remove low-level
efficiency concerns, so programmers can freely concentrate on writing
effective code.
> For more complex code, Java can often perform better than C++.
>
This is such a vague remark... but OK, let's talk about complex code.
The efficiency of complex code hangs on the choice of algorithm, the level
where programmers should concern themselves.
But if such a simple operation as aritmetic iterations is slow, it will be
very hard for Java to compete efficiency-wise on any level.
I would maintain that it would behoove Java greatly, if such simple tests
showed similar performance in Java as in C. As you said, there is no good
reason why it shouldn't.
Then one old, tired, ignorant complaint about Java could be easily
dismissed.
Cheers!
--
| - - - - - - - - - - - - - - - - - - - - - - - - -
| Steve White +49(331)7499-202
| E-Science Zi. 27 Villa Turbulenz
| - - - - - - - - - - - - - - - - - - - - - - - - -
| Astrophysikalisches Institut Potsdam (AIP)
| An der Sternwarte 16, D-14482 Potsdam
|
| Vorstand: Prof. Dr. Matthias Steinmetz, Peter A. Stolz
|
| Stiftung privaten Rechts, Stiftungsverzeichnis Brandenburg: III/7-71-026
| - - - - - - - - - - - - - - - - - - - - - - - - -
More information about the hotspot-compiler-dev
mailing list