17.2. Using Profiling

In the Profiling View, the modules of networks to be profiled are listed.

Figure 17.2. Profiling

Profiling

The consumption is also displayed in the network: Two vertical bars to the left of a module indicate the percentage of memory (m) consumption and time (t) consumption of that module in the current network.

That means that small green dots indicate low memory/time consumption while full magenta or red bars indicate high memory/time consumption. The colors are chosen so that memory and time are easy to distinguish from each other.

The Profiling View and the network are linked as follows:

Options:

Buttons:

17.2.1. Modules

On the Modules tab, the modules and their profiling information are listed. On mouse-over over the headings, a context-sensitive tool tip is displayed for each.

Options:

  • Show macros: If enabled, shows information of macros in the network and of modules inside that macro as a tree. If disabled, the information is flat and without the macros.

  • Show: Defines which networks and depths should be profiled:

    Figure 17.4. Profiling Modules

    Profiling Modules

Right-clicking the headings opens the context menu in which the the columns to be displayed can be configured.

Figure 17.5. Profiling — Heading Configuration

Profiling — Heading Configuration

  • Type: Shows the type of the module.

  • Elapsed Time: Shows the total time spent in the profiled routines (the sum of self-time and time in children).

  • Self Time: Shows the time spent only in routines of the module.

  • Time In Children: Shows the time spent in routines called by the module.

  • Min. Time: Shows the minimum measured total time.

  • Max. Time: Shows the maximum measured total time.

  • Cur. Memory: Shows the memory currently allocated by the module.

  • Memory: Shows the total accumulated memory allocated by the module to ML pages during profiling.

  • Count: Shows a counter of method calls. Expand a module's node to see the details; for example, the calls to calculateOutputImageProperties and to calculateOutputSubImage are counted, Page Cache hits and misses are counted, and calls to scripting methods are counted. On mouse-over, details are displayed.

17.2.2. Fields

On the Fields tab, all fields that have been touched at least once are listed here.

  • Name Shows the field name.

  • Type : Shows the field type.

  • #: Shows the number of field triggers (notifications).

Figure 17.6. Profiling Fields

Profiling Fields

17.2.3. Functions

On the Functions tab, all functions that have been called at least once are listed here.

Right-clicking the headings opens the context menu in which the columns to be displayed can be configured.

  • Type: Shows the function type. The possible types are listed beneath the Function filters button.

  • Elapsed Time: Shows the total time spent in the profiled functions (the sum of self-time and time in children).

  • Elapsed Time per call: Shows the time spent per call.

  • Self Time: Shows the total time spent only in functions of the module.

  • Self Time Per Call: Shows the time spent in functions of the module per call.

  • Time In Children: Shows the time spent in routines called by the module.

  • Calls: Shows the total number of calls for this function (only in Flat Profile view).

Two display options are available from Select view:

  • Flat Profile: Shows the functions in a flat list. No hierarchy/dependency is visible. Calls of the same function are automatically bundled and summed up.

    Figure 17.7. Profiling Functions as Flat Profile

    Profiling Functions as Flat Profile

  • Call Graph: Shows the functions in the hierarchy they were called in. In case of types that should be not displayed due to filtering, these types may still appear if the functions to be displayed are below them in the hierarchy.

    Figure 17.8. Profiling Functions as Call Graph

    Profiling Functions as Call Graph

    Double-clicking a function navigates to the module the function is called in, even if it is in the network of a macro module.

    The option Reduce call graph (resets profiling) combines all calls of the same function to one entry in the call graph list.

Figure 17.9. Functions with Filters Visible

Functions with Filters Visible

When Filters visible is selected, the functions filter options are displayed.

Options:

  • Filter: A text field in which the text to be filtered for can be entered.

  • Time Threshold: Sets a value below which the row is filtered. This way, more time-consuming functions become more visible.

Buttons:

  • Function Filters: Opens a list of all function types, to filter which ones should be displayed. Checked types are displayed.

  • Reset: Deletes entries in Filter and Time threshold and resets the Function filters so that all types are listed again.

The function types have different icons in the list:

Table 17.1. Function Type Icons

TypeIcon
ML call (typically ML image)

ML WEM call

Field call (Field notification)

Python call

Python Qt call

Open GL call


Some special functions:

  • main: pseudo function that is active when profiling is enabled.

  • __tmpScriptHandler: generated Python functions for MDL inline code (“py:some python code”).

  • ScriptFile <inline script definition>: definition of inline script functions.

  • PyModuleName <module>: executed code on Python module level, which is not inside any function; typically called when importing Python modules.

  • <python qt wrapper>: PythonQt wrappers of Qt functions.