The rap against
using Java on HP e3000s looks to be lifting, now that the language is
posting improved performance numbers in its latest release. But some
customers are skipping speed questions altogether by using
application servers and servlets on their e3000s.
Released for the
e3000 in the fall of 1996, Java has been a promise in continual
fulfillment over the past four years. Devotees raved about its
multiple platform compatibility and its advantages over the more
error-prone C, but the 3000 markets chief reservation was the
languages speed. A recent set of benchmarks from the
3000s Commercial Systems Division (CSY) show Java is being
beaten only by a few compilers in a simple test, according to Java/iX
guru Mike Yawn.
The test measured
how many times HP 3000 languages could execute the Sieve of
Eratosthenes, to locate the first 16,384 prime numbers, in 10
seconds. Java/iX, running on a Series 988, showed a best-case HotSpot
compiled performance of 288 times, while Cs performance ranged
from 158 to 702 times. Optimized COBOL managed the Sieve task 182
times.
Yawn presented
the test results at this years SIG Java meeting at HP World,
and was quick to point out that benchmarks can be tailored to make
anything look fast or slow. But the one-page of benchmark code for
interpreted languages like the MPE Posix shell and Perl (slower than
Java/iX), and compiled languages like COBOL (slightly behind
Java/iX), were hand-tuned by CSY lab staff, he added.
If you look
at the whole range of compilers, Java comes off a lot better than if
you compare it to optimized C, Yawn said. But not
everybodys running optimized C. A lot of people are doing
things in command files. All interpreted languages had scores of 2 or
less. If youre doing things in an interpreted language, you
would probably see better performance going to
Java.
Were
in the range of compiled language performance, Yawn said.
If you try to conclude anything from this, your conclusion
would almost certainly be wrong. But it said to me that running Java
would compare very favorably with interpreted languages, and we look
very competitive with compiled languages on the HP
e3000.
The HotSpot Java
compiler, due out for the 3000 in the MPE/iX 7.0 Express 1 release
and now in beta test, puts us competitive with COBOL,
Yawn said. Thats where we really need to be on the
platform. It speeds up memory management and garbage
collection, he added.
The benchmark
does no object creation, a typical Java task that affects
performance. It has no IO like most HP 3000 applications, but Yawn
said that CSY may get around to releasing some numbers for a
TPC benchmark written in Java. He added in a quip at the Java
meeting, We might do it, but only if we like the
answers.
All four
variations of Java tested are based on the Java 1.2.2 JDK kit,
available as a supported download from the CSY Jazz Web site. And
that HotSpot release of Java is coming. Weve got a road
map of doing performance enhancements more aggressively than most of
these other languages will be doing performance enhancements,
Yawn said.
Understanding the
language is the key to getting top performance out of Java, he added,
a rule that holds for any compiler. If youre a very
experienced COBOL programmer and a really rookie Java programmer,
your first programs probably wont run as fast as your COBOL
programs, Yawn said. Theres lot of Java profiling
options to help you get information and move your performance
along.
Servlets and app
servers
Another way to
boost Java performance involves doing less startup overhead for
applications on the 3000. Servlets and application servers make this
possible, incurring the startup penalty by eliminating the process
creation associated with CGI creation. Servlets is a way to do
Java code that runs inside the Web server, compared to applets, which
run in the browser client side, Yawn said. Servlets allow for
session persistence and have faster startup times than traditional
CGI once the first user in has started the 3000s Java Virtual
Machine.
The HP 3000 has
beta-test versions of servlets for the 1.3.9 Apache Web browser, both
in its secure and non-secure versions. The software, supported
through e-mail only while its in beta, is available from
jazz.external.hp.com/src/jserv. Sites must be running MPE/iX 6.0 or
later, Apache/iX 1.3.9 beta or WebWise Secure Web Server for MPE/iX;
install beta test patch MPELX44 for 6.0 or 6.5 (which fixes a
DSO-related problem, and requires an HP support contract) and any of
the Java/iX versions: 1.1.7B, 1.2, or 1.2.2.
The free Enhydra
application server, running on HP 3000s in production (see related
story, page 1) and Java servlets are similar, in that they
reduce the startup overhead by running continuously, said HP
Response Center engineer Lars Appel. In fact the Enhydra
application framework is a Java servlet itself.
Yawn said that
Web servers by themselves dont offer the advantages of an
application server like Enhydra, which provides transactional access
to data, security, resource pooling and failovers. If you had a
Web server only, youd have to write all those pieces
yourself, he said.
Creating Java
applications using an application server is simpler, Yawn
noted in a recent chat on 3kworld.com, because many of the
things you might otherwise have to worry about (like multithreading)
are done for you by the servlet engine or application server. So you
just worry about your business logic.
In the last
year it seems like Java has gotten a lot more real for a lot of
people, said SIG Java co-chair Gavin Scott of Allegro
Consultants. A lot of people are starting to roll out
applications. Scott recommended Bruce Eckels
Thinking in Java as the best single book to learn the
language. The book can be downloaded free off the Web as a 4Mb PDF
file from www.planetpdf.com/codecuts/pdfs/bruceeckel/TIJ2.pdf.
CD-ROM versions
of Eckels presentations are available from his Web site at
www.bruceeckel.com. If youre coming from a traditional
3GL environment and dont get the objects thing yet,
theres a lot of good stuff in there for that, Scott said.