[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Compiling Java code for speed?

Posted on 2005-04-21
10
Medium Priority
?
254 Views
Last Modified: 2013-12-14
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).
0
Comment
Question by:agrees
10 Comments
 
LVL 86

Assisted Solution

by:CEHJ
CEHJ earned 100 total points
ID: 13831568
0
 
LVL 92

Expert Comment

by:objects
ID: 13831572
may find some useful tips under this umbrella:
http://java.sun.com/performance/
0
 
LVL 92

Expert Comment

by:objects
ID: 13831582
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 92

Expert Comment

by:objects
ID: 13831588
0
 

Author Comment

by:agrees
ID: 13831787
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?
0
 
LVL 92

Expert Comment

by:objects
ID: 13831800
You're probably better off looking at vm settings as opposed to compiler setting such as the gc settings.
0
 
LVL 92

Accepted Solution

by:
objects earned 300 total points
ID: 13831808
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 13832749
>>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
0
 
LVL 15

Assisted Solution

by:aozarov
aozarov earned 100 total points
ID: 13852630
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
see http://www.geocities.com/marcoschmidt.geo/java-class-file-optimizers.html
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 13916614
:-)
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
This video teaches viewers about errors in exception handling.
Suggested Courses
Course of the Month18 days, 1 hour left to enroll

829 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question