speed of simple loops: comparison to other language
Osvaldo Doederlein
opinali at gmail.com
Thu Jul 1 06:30:18 PDT 2010
Hi,
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?
>
Perhaps the single "anomaly" in these tests, is the fact that the 64-bit
HotSpot doesn't have a Client VM, so it uses the Server VM by default. This
is constant cause of benchmark confusion because the 32-bit VM will default
to the Client VM, which has a weaker code optimizer. A fair comparison
should use "-server" on the 32-bit VM.
> 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.
>
>
The simpler Client VM is a well-known tradeoff. It has substantial
advantages in both memory usage and startup time. The Server VM is the only
one that really competes with C/C++, but it's much more heavy-weight. And
even with the Client VM being the default in the JRE installed in hundreds
of millions of consumer PCs, Java already has a bad rep for its loading time
and resource usage (although Sun/Oracle has been sweating to reduce these
issues since JDK 6u10). This makes easy to understand the reason that Server
is not the default, and it won't be any time soon. In fact, the only reason
that a 64-bit port of the Client VM is not available, is that 64-bit
consumer/desktop stuff is generally not very widespread yet (most browsers
are 32-bit; there's no 64-bit port of other plugins like Adobe flash, etc.).
But I hope this will change soon, I'd kill for a 64-bit JRE that includes
the Client VM so I can make my Windows7-64 setup more "pure".
On Java competitiveness, with the client VM we're talking about desktop
software for which resource usage and startup time are at least as critical
as speed, so the Client VM is the right choice (or at least, the best
possible choice with the Sun/Oracle JDK; for an alternative that approaches
a combination of Client-like resource usage with Server-like optimization
[but then has other tradeoffs], look at the JET static compiler). People who
run Java servers know that they must put "-server" in the launch scripts,
then all is well.
A+
Osvaldo
> --
> | - - - - - - - - - - - - - - - - - - - - - - - - -
> | 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
> | - - - - - - - - - - - - - - - - - - - - - - - - -
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/hotspot-compiler-dev/attachments/20100701/e9a92a17/attachment.html
More information about the hotspot-compiler-dev
mailing list