IDL

PROFILER

PROFILER

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.

Examples


; 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

Syntax


PROFILER [, Module] [, /CLEAR] [, DATA=variable] [, FILENAME=path] [, OUTPUT=variable] [, /REPORT] [, /RESET] [, /SYSTEM]

Arguments


Module

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.

Keywords


CLEAR

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.

DATA

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}

FILENAME

If the REPORT keyword is set, then set this keyword to the name of a file in which to write the profile results.

OUTPUT

If the REPORT keyword is set, then set this keyword to a specified variable in which to store the results of the REPORT keyword.

REPORT

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.

RESET

Set this keyword to reset the results of profiling. If this keyword is present then all other arguments and keywords are ignored.

SYSTEM

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.

Note: Using the profiler incurs a small overhead for each call to a routine. For routines which execute quickly, this overhead may be a significant fraction of the total execution time. Because of this, when you turn on profiling for all system routines, the following routines are not included: ARG_PRESENT, KEYWORD_SET, N_ELEMENTS, OBJ_ISA, OBJ_VALID, PTR_VALID, and SIZE. You can manually turn on profiling for these routines using the Module argument.

Version History


5.1

Introduced

7.0

Added FILENAME keyword

See Also


SYSTIME, TIC, TOC



Notes


This page has no user notes yet. Be the first one!


This information is not subject to the controls of the International Traffic in Arms Regulations (ITAR) or the Export Administration Regulations (EAR). However, it may be restricted from transfer to various embargoed countries under U.S. laws and regulations.
© 2014 Exelis Visual Information Solutions