TEAM-ADA Archives

Team Ada: Ada Programming Language Advocacy

TEAM-ADA@LISTSERV.ACM.ORG

Options: Use Classic View

Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Topic: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Geoff Bull <[log in to unmask]>
Fri, 9 Mar 2001 12:07:17 +1100
text/plain (36 lines)
[log in to unmask] wrote:
>
> Essentially any criticism of Java's performance must be aimed at the JVM.
> Ultimately, as long as Java runs on the JVM, it is *never* going to be as quick
> as a compiled-to-native-code language.

I don't agree with this since the latest JVMs essentially compile
to native code at runtime anyway.

There are a number of obstacles to good Java performance.
The first is that the language design only allows classes, the only form
of
abstraction provided, to be allocated on the heap. Sun's JVM
has a very fast allocator. I have found Java code will give "native"
code
a run for its money if both are doing similar amounts of heap
allocation.

Another bottleneck I have uncovered with Java is the inability to turn
off run time checks. This is noticeable with "generic" collection
classes
- when casting an Object back to its true type a runtime  check is
performed.
In some cases I have gained massive performance improvements by
replacing
a class in java.util with my own class specific version.

One reason for using Java is that one can often get a program going in
less
time than with C/C++. This is also true of Ada, of course, but most
people don't
want to know it.

Cheers
Geoff

ATOM RSS1 RSS2