This week's book giveaway is in the OCMJEA forum. We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line! See this thread for details.
I'll move this over to the Performance forum. If you can flesh out some of the above perhaps someone can help.
Of course, the single most important question you need to ask before spending more than a cursory amount of time on optimising performance is "do I have a performance problem?". If you don't, don't bother.
The simplest answer is that you oughtn't to do anything. Read a couple of articles by Brian Goetz I found: this one, and this one.
The one thing you can do is to check for inefficient algorithms, eg
Using + or += in multiple lines for String concatenation.
Using O(n^2) sorting algorithms rather than O(n log n).
In general, as Goetz tells us, it is better to write simple code and leave the optimisation to the compiler, and not to try lots of micro-management. This applies to other languages too, see for example Miller and Quilici the Joy of C where they have some figures about C optimisation.
Joined: Oct 13, 2005
Originally posted by omi sharma: I thought there is some classes by which we can provide good performance and the technic is called profiling if I am not wrong.
Yes, profiling is available, but I know nothing about it.
If you go through the classes in the collections framework, eg ArrayList, LinkedList, they tell you the complexity they run in. Read the API documentation for those two classes and see where they would provide the better performance.