HotSpot arrives
ChrisRijk writes "See the HotSpot
main-page for starters. HotSpot is basically a fast JVM,
initially aimed at server-side Java - beta testers say it's 2x or more
faster in real world applications - see this good
article (not by Sun). See also the press release,
FAQ,
and white
paper.
Freely downloadable binaries available later this week. Linux port?
Well, Sun are liscencing the code (for a fee), and claim to have
designed it to be easily portable. Sun also announced their
i-Planet
software today - see this news.com article.
"
Ask yourself this question: What would Java be like now if it was an open language from the start?
The answer is: Two languages. One supported by Sun which would be secure and platform independant. And the other supported by Microsoft which would be Windows only and insecure.
Unfortunatly, it would be Microsoft's version which would attract most of the programmers, because Microsoft is very good at wielding their OS monopoly. As a result, not only would we be asking companies for Linux versions of their C/C++ programs, but we'd also be asking for Pure Java versions of their J++ programs.
Sun fought for, and won the removal of those extentions which would have split the language. Not that I don't think it should eventually be opened up, but if Java was an open language back then, or even if it opened up right now, those extentions would still be around.
A lot of you don't like Sun, and as a result resent their control over Java. However they know what needs to be done to keep Java alive and they have the lawyers to do it. As long as Sun controls Java, it will still stand for the same things: platform independance, security, and probably some other stuff a more experienced Java programmer could fill in.
As far as waiting on Java, I somewhat agree with you. I still don't trust it enough to bet the farm on it, but it's the performance issues that worry me, and it looks as if those aren't going to be around long.
Sorry I'm writing this as A.C. However, I don't want to compromise my company's standing with Sun.
My company has been an alpha tester of HotSpot for quite a while. I've seen several alpha versions. Each one improves upon the previous by a factor of about 2x. However, the latest alpha (actually, a release candidate) was still 2x *slower* than the JIT in Sun's JDK1.2, under WinNT.
Our code is *not* in one giant loop. It is, however, heavily dependant upon floating-point calculations and array accesses. To be honest, there are supposedly a few bugs in their floating point math (are they implementing IEEE FP calculations in software???). We'll see if this is fixed in the latest version.
The garbage collection is *greatly* improved. Unlike JDK 1.1.x and JDK 1.2, you never even notice when the garbage collection occurs (no long pauses).
I keep hoping that they will optimize out array bounds checking (if your code permits), but I have not seen any evidence of this. Removing array bounds checking has been shown to make heavy computational code (like mine) run about 8x quicker (almost 100% of my computations are performed on data in arrays). Conditionals really screw up a CPU's pipeline, as each array bounds check results in a branch. In fact, the Java Grande group, a group experimenting with numerical algorithms and Java, has shown that with a few alterations to the JVM (removing bounds checking among them), Java runs numerical algorithms about 10% slower than C++! And that's without any dynamic optimization!
I has been told that the public release is supposed to fix any problems that slow down my code. However, I have not had any pre-release access to this latest code. We shall see.
All in all, I wouldn't hold my breath. Java is still young, and technologies like HotSpot are still in their 1.0 (pre)release. I hope for the best with HotSpot, but I am afraid it will greatly disappoint most users...
Fast JVM: 29.1 SPECjvm (1x 500Mhz Alpha EV6 on Tru64 Unix)
HotSpot: 31.1 SPECjvm (2x 450Mhz PII on NT4)
HotSpot: 31.9 Specjvm (1x 450Mhz UltraSparc-II with Solaris 7)
(don't ask me what diff the dual PII's made for the HotSpot one. unfortunately they don't publish result for single-processor) Also, the 450Mhz UltraSparc-II won't be out for a few more weeks. A 450Mhz PII has 17.2 SPECint95 and 12.9 SPECfp-95. A 450 Mhz UltraSparc-II has 19.6 SPECint95 and 27.1 SPECfp95. A 500Mhz EV6 Alpha is rated as 27.3 SPECint95, and 57.7 SPECfp95.
I don't have general volano marks available. Also, you can probably see what Sun are initially targeting HotSpot mostly at server side (for now anyway) as the effect is much greater compared to client side (because the longer HotSpot runs for the faster it gets, and because client side has much more interaction with the OS). Check the the article on 'real world' apps posted at the top. 2x, and up to 4x faster in heavy duty real world server apps compared to other recent JVMs is pretty good. The beta-testers particularly praised the high-speed, low latency garbage collector. (wha-hey, Sun build a better bin!).
As a final note, HotSpot will be getting faster (the 2nd release will apparantly be 30% faster), as will everyone else's of course.
A HotSpot beta-tester wrote a long, detailed article to the newsgroups. You'll probably find it an interesting read. Find it here
I agree that dynamic optimization is a very exciting concept and a lot of compiler research is going to go in that direction. However, if it gives Java an advantage over C/C++, it will only be because more resources are being spent improving the Java JVMs and compilers than are being spent improving the C/C++ compilers.
The initial demonstration of a lot of the concepts in HostSpot are from Self, a O-O prototype-based language, whose implementation does a lot of dynamic optimization. In the Self implementation the optimization actually takes place on machine instructions and not via intermediary VM instructions (which is why the Self implementation is closely tied to Sparc procesors). So having a VM-based language is not a prerequisite for doing these sorts of optimizations.
The future of compilation, IMHO, is compiling your code with profiling information included, running your app for awhile, and then feeding the profile back into the compiler for more information to generate your final optimized executable.
Granted that C/C++ aren't dynamic O-O languages, so many of the specific optimizations that Self/HotSpot are doing won't apply, but I still think there is a lot that could be done. And compiled Java, Objective-C, Eiffel, et cetera could all benefit from the HotSpot optimizations done with compiling and profiling as above.
It's good to see this come out finally, after the years (literally!) of hype. Dynamic optimization is great technology, and I suspect where a great deal of compiler research will head in the future; it could eventually give Java an actual speed *advantage* over C/C++ (or even hand-tuned ASM), since the fact that it's only semi-compiled means higher-level information is still available at runtime from which to optimize... which is IMHO good in terms of software engineering as well, because it means it'll become even less neccessary (and less possible) to hand-optimize the smeg out of code at the price of maintainability.
Reading between the lines here, though, it sounds like HotSpot's analysis phase is currently the bottleneck. They keep saying that it's good for server-side application rather than client-side; I suspect that despite their claims that 'server applications are more VM-intensive', this is actually due to the fact that it takes a while during any given session to analyze the code far enough to realize the speedup (less of a problem for servers, for which sessions are typically very long). Of course, there are good ways around this besides just improving the analysis -- specifically, saving analysis info across sessions (ship your app with a baseline analysis, which will then be modified gradually by the user's VM based on their usage patterns).
-spc
Now the big question is going to be how much will they charge for the real deal. Given how poor and late it is compared to what they promised, they should give us all copies of it with a check for $2.50. But it's far more likely that they'll try to recoup development costs by charging an arm and a leg for the "real" version. Oooo, maybe if I pay double, I can get a 2.5x increase.
www.HearMySoulSpeak.com