|
IDL Reference Guide: Procedures and Functions |
|
The PROFILER procedure allows you to access the IDL Code Profiler. The IDL Code Profiler helps you analyze the performance of your applications. You can easily monitor the calling frequency and execution time for procedures and functions.
PROFILER [, Module] [, /CLEAR] [, DATA=variable] [, OUTPUT=variable] [, /REPORT] [, /RESET] [, /SYSTEM]
The program to which changes in profiling will be applied. If Module is not specified, profiling changes will be applied to all currently-compiled programs.
| Note The Module is often named with respect to the file in which it is stored. For example, the file build_it.pro may contain the module, build_it. If you specify the file name, you will incur a syntax error. |
Set this keyword to disable profiling of Module or of all compiled modules if Module is not specified. If the Module is a system routine then the SYSTEM keyword must also be set.
If the REPORT keyword is set, then set this keyword to a specified variable containing output of the report as an unnamed structure with the following tags and data types:
{NAME:char, COUNT:long, ONLY_TIME:double, TIME:double,
SYSTEM:byte}
If the REPORT keyword is set, then set this keyword to a specified variable in which to store the results of the REPORT keyword.
Set this keyword to report the results of profiling. If DATA or OUTPUT are present then the results are returned in the specified variables. Otherwise the results are output to the IDL output log.
Set this keyword to reset the results of profiling. If this keyword is present then all other arguments and keywords are ignored.
Set this keyword to apply profiling changes to IDL system procedures and functions. By default, changes are only applied to user-written or library files.
; First ensure that the routine you want to profile is compiled. void = DIST(500) ; Now include both user routines and system routines. PROFILER PROFILER, /SYSTEM ; Now perform the actual commands to profile. a = DIST(500) TV, a ; Retrieve the profiling results. PROFILER, /REPORT
IDL prints:
Module Type Count Only(s) Avg.(s) Time(s) Avg.(s) DIST (U) 1 0.004473 0.004473 0.014675 0.014675 FINDGEN (S) 1 0.000015 0.000015 0.000015 0.000015 FLTARR (S) 1 0.000036 0.000036 0.000036 0.000036 N_ELEMENTS (S) 1 0.000004 0.000004 0.000004 0.000004 ON_ERROR (S) 1 0.000003 0.000003 0.000003 0.000003 SQRT (S) 251 0.010144 0.000040 0.010144 0.000040 TV (S) 1 0.089689 0.089689 0.089689 0.089689
IDL Online Help (March 06, 2007)