Csound Csound-dev Csound-tekno Search About

HotSpot Java Compiler

Date1999-05-01 02:29
FromMichael Gogins
SubjectHotSpot Java Compiler
HotSpot has arrived and I have downloaded it from
http://www.javasoft.com/products/hotspot/index.html.

I have performed some very preliminary but nevertheless significant tests,
profiling two of my all-Java applications on my Pentium II 128 MB 450 MHz
PC.

ImageToSound (translates 1024 x 768 color bitmap to CD quality WAV soundfile
using additive synthesis implemented by a bank of 768 interpolating
wavetable oscillators. Very compute intensive with floating-point
multiplication, nested loops, soundfile I/O. Translate the same GIF image to
10 second soundfile.

jdk1.2 "HotSpot" java compiler:     281.50 seconds.    HotSpot/Classic:
1.742063246
jdk1.2 "Classic" java compiler:     161.59 seconds.

Silence music graph generation (generate a minimalist score from a large
MIDI sequence with extensive score warping, filtering, pitch-class
transformations, and rescaling to produce 22,128 notes). Very compute
intensive with matrix multiplication, logic, nested loops, interface
casting, XML writing and file I/O, etc., etc.

jdk1.2 "HotSpot" java compiler:        35.92 seconds
HotSpot/Classic:    0.599465955
jdk1.2 "Classic" java compiler:        59.92 seconds

Note that the simpler application was SLOWER with HotSpot than without.
Presumably, the regular JIT did as much or more effective optimization than
HotSpot in the single large method that does the synthesis (I did remember
to run the method several times, to allow HotSpot to optimize it, before
timing it).

Note, too, that the more complex application WAS SIGNIFICANTLY FASTER with
HotSpot than without.

Since I and others have found JIT Java compilers 3 times slower than
compiled and optimized C++, it would seem that with HotSpot and the right
kind of application, the gap has narrowed to 1.5 times slower than compiled
and optimized C++.

HotSpot also seems to manage memory much better than the older compiler,
with much less disk thrashing. HotSpot did not crash due to memory leakage
as the older compiler tended to do after several runs.


In my opinion, this is a significant improvement that warrants a much closer
and more detailed evaluation, even a preliminary commitment, on a case by
case basis, to use HotSpot for music and DSP.