I saw on a article that put forth this statement:Developers love to optimize code and with good reason. It is so  satisfying and fun. But knowing when to optimize is far more  important. Unfortunately, developers generally have horrible intuition  about where the performance problems in an application will actually  be.How can a developer avoid this bad intuition? Are there good tools to find which parts of your code really need optimization (for Java)? Do you know of some articles, tips, or good reads on this subject?
How do I avoid Developer's Bad Optimization Intuition?
java;performance
Use a good profiler to identify expensive methods.Document how long the hot spots actually took.Write a faster implementation of the hot spotsDocument how long the hot spots now take, hopefully not making them hotspots anymore.Essentially you need to be able to prove to others where the problem was, and that this change made it go away.EDIT:  Not being able to prove an improvement, qualifies - in my personal opinion - for immediate rollback to the original version.   