The Artima Developer Community
Sponsored Link

Legacy Design Forum
The Hotspot Virtual Machine



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.


Java Synthesizer

Posted by malcolm Bailey on June 18, 2001 at 11:24 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.

Hi Michael,

I've just read the above. I'm an MSc student at Napier University in Edinburgh, Scotland. I'm currently doing ap project looking into the sound capabilties of Java. What I would like to know is, what version of Java did you use?

Look forward to hearing from you.

Yours sincerely,

Malcolm Bailey


Sponsored Links

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