Reputation: 705
How can I trace a Java program performance? Example, how long each method takes? How many resources were used and so on? I need some info for me to work on optimizing my Java program.
Upvotes: 0
Views: 932
Reputation: 1628
In optimizing, it's hard to tell what causes the slow performance. Usually a bad algorithm (complexity) causes it. Maybe you can start from the algorithm first before go into further detail tweak
Upvotes: 0
Reputation: 6344
As others previously mentioned, profilers are the go. A long time ago, I'd used http://www.yourkit.com/, and found it quite easy to use and informative.
If you are keen, you could investigate using AOP for method timing etc. Just search Google for AOP method timing for some ideas.
Upvotes: 2
Reputation: 3191
Making a good and robust benchmark in java is hard. Take a look at the following articles: http://www.ibm.com/developerworks/java/library/j-benchmark1/index.html http://www.ibm.com/developerworks/java/library/j-benchmark2/index.html
Upvotes: 0
Reputation: 8506
You could try opening your project in Netbeans, from there you can use the Profiler tool and get performance data for methods, load times, etc. It's really easy to use and the data is very complete.
Upvotes: 0