The Artima Developer Community
Sponsored Link

JIT Performance

Advertisement

Advertisement

This page contains an archived post to the Design Forum (formerly called the Flexible Java Forum) made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.

Message:

JIT Performance

Posted by Michael Gogins on 26 Mar 1999, 8:57 AM

I have some concrete experience to offer here. I coded a software music synthesizer kernel in ANSI C++ using Microsoft VC++ 5.0 and in JDK1.1 using Symantec Visual Cafe on Windows 95. I did the Java program first, and the C++ second, based on the Java program. I then tested a frequency modulation instrument's performance in the Java synthesizer, the C++ synthesizer, and a similar instrument in Csound, a longstanding and powerful software synthesizer written in C. Csound was fastest, C++ was 1/2 as fast as Csound, and Java was 1/3 as fast as C++ (or 1/6 as fast as Csound).

Note that Csound, though written in C, is itself a runtime compiler, and the fast synthesis code is itself a sort of byte code (threaded lists of calls to C functions).

For sound synthesis, where performance is critical, this means that Csound (or C) is still the language of choice, C++ is usable, and Java is still too slow.

The code involved a number of classes, many dynamic method invocations, and a lot of floating-point multiplications and array lookups.

Interestingly, the Java synthesizer took 1/3 as long to write as the C++ one, in spite of the fact that I did the Java one first and had done similar C++ code in the past!

As a result of this experience, I changed to using Java for all of my new software development except where performance is critical, where I continue to use C++ or C.

> > So, where is the evidence that Java is 3 to 10 times slower
> > with a JIT?
> >
> I believe I got those particular numbers from a Sun person who
> was giving a talk either at JavaOne or at a pre-JavaOne talk
> that I was invited to. I'd have to look back at my notes to
> be sure.




Replies:

Sponsored Links



Google
  Web Artima.com   
Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us