Performance benchmarks Java vs C(++) ?

L

Lew

Roedy said:
But nobody has used interpreted byte code in Java for years, except in
cell phones where RAM and batter power is limited. [...]

Eric said:
If batter power is limited, the infield crowds the plate
anticipating a bunt.

"Ah that's very good. I never thought of that before.
What a silly bunt."
 
A

Arne Vajhøj

Roedy said:
On the desktop it
is now hotspotted (Sun JVM) or native machine code (Jet).

I don't think I have ever seen an actual app using Jet.

There must be some since the company is still in business,
but I don't think their market share in the general Java
market is that big.

Arne
 
R

Roedy Green

My understanding is that in the Sun JVM, bytecode is still interpreted
before it gets hotspotted. Unlike the IBM JVM, for instance, where it's
always compiled (although with a quick, poor compiler at first, there
being a hotspot-like compiler to redo important bits later). I could be
out of date on this, but if i'm not, then we're all using interpreted code
every day.

Yes, initialisation code that gets run only once would not be
hotspotted. It would be run in interpreted form (more compact but
slower) Over time the hotspot engine gradually refines the
optimisation based on usage. However, the entire process is referred
to as hotspotting -- a combination of interpreted, native code, and
highly optimised native code.

It is absolutely mind boggling the way it can change code on the fly
right in the middle of execution. For example, when you load a new
class, what before was effectively final stops being so.

Benchmarks tend to run the same code over and over. They would soon
get optimised, so long as your benchmark ran long enough.

Hotspot has the advantage of run-time knowledge of what branches in
the code are most commonly executed. Native compilation has the
advantage of being able to take as long as it wants with the
optimisation.
--
Roedy Green Canadian Mind Products
http://mindprod.com
PM Steven Harper is fixated on the costs of implementing Kyoto, estimated as high as 1% of GDP.
However, he refuses to consider the costs of not implementing Kyoto which the
famous economist Nicholas Stern estimated at 5 to 20% of GDP
 
R

Roedy Green

I was on a project in the early 1990s that interpreted HP Business
BASIC on a '386 PC with performance equivalent to HP's own compiled
version of that language on their own mainframe. That interpreter
didn't even have an equivalent to Java's Hotspot compiler; it was just
efficient.

Charles Moored designed a CPU for Forth interpreting. He was able to
get RETURNs for free, and CALL in one machine cycle. This was because
the CPU used the interpreter's format as its own instruction format.

Back in the 80s Russians did similar work. They had only 8086-level
chip manufacturing, so for speed had to go for Forth-in-hardware style
chips.

When Sun built its picojava chips they use Java's interpreted format
as the machine code format. For reasons I do not understand, these
chips ran too hot (used to much power), so Sun reverted to traditional
architectures.
--
Roedy Green Canadian Mind Products
http://mindprod.com
PM Steven Harper is fixated on the costs of implementing Kyoto, estimated as high as 1% of GDP.
However, he refuses to consider the costs of not implementing Kyoto which the
famous economist Nicholas Stern estimated at 5 to 20% of GDP
 
R

Roedy Green

there is dynamic decompilation back
to bytecode and recompilation to machine code as the performance
characteristics of the program vary over time.

Really? Surely it would be easier and safer just to go back to the
byte code. That sounds pretty hot-shot fancy pants.
--
Roedy Green Canadian Mind Products
http://mindprod.com
PM Steven Harper is fixated on the costs of implementing Kyoto, estimated as high as 1% of GDP.
However, he refuses to consider the costs of not implementing Kyoto which the
famous economist Nicholas Stern estimated at 5 to 20% of GDP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,772
Messages
2,569,592
Members
45,104
Latest member
LesliVqm09
Top