Compiling Java code for speed?

Hi all,

I have a java protocol stack and I'm trying to see if it can get comparable speed to a C++ stack.  

Is there a way to compile java code so that it is optimised for speed?  Currently I am using the eclipse IDE compiler.  I tried running it from inside the IDE and from a .jar but it didn't seem to improve performance much.  

Is there anything else I can do to increase the performance of a java application?  (I'm running on windows XP using JDK 1.5).
Who is Participating?
may find some useful tips under this umbrella:
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

agreesAuthor Commented:
Thanks for the links.  I couldn't see a great deal about compilation settings - more about writing efficient code.  The code wasn't written by me so I am not too interested in coding improvements at this stage.  (It was actually written by Sun and the US government - so hopefully it is fairly well written!)

At the moment, I'm more interested in any compiler settings etc that can be tweaked to increase performance.  

For example, I have access to Jbuilder, Eclipse and Netbeans - are there any settings in those which can be tweaked to improve performance?

The reason I ask is that I have some experience of embedded C programming and you could change compile options to optimise for speed or small footprint.  I'm guessing (hoping!) that there is something similar for java?
You're probably better off looking at vm settings as opposed to compiler setting such as the gc settings.
>>programming and you could change compile options to optimise for speed or small footprint.

Not really. The most you could do is to profile the bytecode produced by different Java compilers
Though I agree with objects that you should put your focus on the jvm (memory and gc settins) the option
of byte code optimization is avaiable
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.