Find the causes of code performance problems
Overview
After you have collected response time breakdown data, you can analyze the results in the profiling tools to identify exactly what part of the code is causing the problem.To identify and fix problem code...
- Narrow down the component (which application on which server) has the problem
- Continue narrowing down to determine which package, class, and finally method is causing the problem
- Go to the source code to fix it.
You can view response time breakdown data in...
- Test perspective
Window | Open Perspective | Performance Test
- Profiling and Logging perspective.
Window | Open Perspective | Other | Profiling and Logging
To narrow down the location of the problem
- Identify the phases of program execution and identify resource-intensive methods
The Execution Flow and the Method Invocation views display all the response time breakdown data for the run.
- Use UML2 Trace Interaction views.
Start at the host interactions level and drill down to process interactions, thread interactions, class interactions, and possibly object interactions.
To open the host interactions view:
- Select the monitor object.
- From the monitor object pop-up menu, select...
Open With | UML 2 Host Interactions
- Ensure the Distributed Layout is selected for the Profiling Monitor view.
Look for "hot spots" indicated by a red spot on the Time Compression bar on the left-hand side of the sequence diagram. These indicate major delays or errors associated with events such as method calls. Note these problematic sections of code.
- Use the Execution Statistics view
With the statistical tables, you can see which package, classes, or methods are taking the most time. Examine areas that were highlighted as problematic in the sequence diagram, and note the problems highlighted in the statistical tables.
- Examine the source code.
Once you have used the profiling tools to narrow down where the problem is, use the source views and editors to manually examine the sections of code highlighted by those other methods, to determine what is wrong with the code.
Related
Problem analysis overview Common application performance problems Customize real-time profiling settings Import a log file Analyze log files Use profiling views to analyze data View performance bottlenecks Use the Profiling Monitor view