Oracle TopLink Developer's Guide
10g Release 3 (10.1.3) B13593-01 |
|
![]() Previous |
![]() Next |
The most important challenge to performance tuning is knowing what to optimize. To improve the performance of your application, identify the areas of your application that do not operate at peak efficiency. The TopLink performance profiler helps you identify performance problems by logging performance statistics for every executed query in a given session.
Note: You should also consider using general performance profilers such as JDeveloper or JProbe to analyze performance problems. These tools can provide more detail that may be required to properly diagnose a problem. |
The TopLink performance Profiler logs the following information to the TopLink log file (for general information about TopLink logging, see "Logging"):
Query class
Domain class
Total time, total execution time of the query (in milliseconds)
Local time, the amount of time spent on the user's workstation (in milliseconds)
Number of objects, the total number of objects affected
Number of objects handled per second
Logging, the amount of time spent printing logging messages (in milliseconds)
SQL prepare, the amount of time spent preparing the SQL script (in milliseconds)
SQL execute, the amount of time spent executing the SQL script (in milliseconds)
Row fetch, the amount of time spent fetching rows from the database (in milliseconds)
Cache, the amount of time spent searching or updating the object cache (in milliseconds)
Object build, the amount of time spent building the domain object (in milliseconds)
Query prepare, the amount of time spent to prepare the query prior to execution (in milliseconds)
SQL generation, the amount of time spent to generate the SQL script before it is sent to the database (in milliseconds)
This section includes information on the following topics:
To enable the TopLink performance profiler, select the TopLink profiler option when configuring your session (see "Configuring a Performance Profiler").
The TopLink performance profiler is an instance of oracle.toplink.tools.profiler.PerformanceProfiler
class. It provides the following public API:
logProfile
–enables the profiler
dontLogProfile
–disables the profiler
logProfileSummary
–organizes the profiler log into a summary of all the individual operation profiles including operation statistics like the shortest time of all the operations that were profiled, the total time of all the operations, the number of objects returned by profiled queries, and the total time that was spent in each kind of operation that was profiled.
logProfileSummaryByQuery
–organizes the profiler log as query summaries. This is the default profiler behavior.
logProfileSummaryByClass
–organizes the profiler log as class summaries. This is an alternative to the default behavior implemented by logProfileSummaryByQuery method
.
The simplest way to view TopLink profiler results is to read the TopLink log files with a text editor. For general information about TopLink logging, such as logging file location, see "Logging".
Alternatively, you can use the graphical performance profiler that the TopLink Web client provides. For more information, refer to the Web client online Help and README files.
Example 11-1 shows an example of the TopLink profiler output.
Example 11-1 Performance Profiler Output
Begin Profile of{ ReadAllQuery(oracle.toplink.demos.employee.domain.Employee) Profile(ReadAllQuery,# of obj=12, time=1399,sql execute=217, prepare=495, row fetch=390, time/obj=116,obj/sec=8) } End Profile
The second line of the profile contains the following information about a query:
ReadAllQuery(oracle.toplink.demos.employee.domain.Employee)
: specific query profiled, and its arguments.
Profile(ReadAllQuery
: start of the profile and the type of query.
# of obj=12
: number of objects involved in the query.
time=1399
: total execution time of the query (in milliseconds).
sql execute=217
: total time spent preparing the SQL script.
prepare=495
: total time spent preparing the SQL script.
row fetch=390
: total time spent fetching rows from the database.
time/obj=116
: number of milliseconds spent on each object.
obj/sec=8) */
: number of objects handled per second.