Requires: Base Development System
Select Tools»Profile»Performance and Memory to display this window.
Use this window to acquire and display data about the execution time and memory usage of VIs. If you display the Profile Performance and Memory window from a VI that is not part of a project, the window profiles all open VIs that do not belong to a project. If you display the Profile Performance and Memory window from a project or VI that is part of a project, the window profiles the VIs in all targets associated with the project. You can only profile the VIs in one project at a time.
|Note You can use the LabVIEW VI Analyzer Toolkit to check VIs interactively or programmatically for performance, efficiency, and other aspects of LabVIEW programming.|
This window includes the following components:
- Timing statistics—Displays the following statistics for the VI run time:
- # Runs—Number of times that the VI completed a run. For global VIs, this time is the total number of times any of its controls were accessed.
- Average—Average amount of time spent by the VI per run. This is the VI time divided by the number of runs.
- Shortest—Minimum amount of time the VI spent in a run.
- Longest—Maximum amount of time the VI spent in a run.
- Timing details—Displays the following details about the VI run time:
You can choose the timing format (microseconds, milliseconds, or seconds) in the pull-down menu beneath the Timing details checkbox.
- Diagram—Time spent only executing the code generated for the block diagram of the VI.
- Display—Time spent updating front panel controls of the VI with new values from the block diagram. Display can be inaccurate if you do not right-click the control or indicator and select Advanced»Synchronous Display from the shortcut menu. You can use Synchronous Display to set whether to defer updates for controls and indicators.
- Draw—Time spent drawing the front panel and block diagram minus the Display time. Draw time includes the time required to draw a front panel when its window has just been opened or when it is revealed after being obscured by another window. Draw time also includes the time required to draw controls that are transparent or overlapped. These controls must invalidate their area of the screen when they receive new data from the block diagram so everything in that area can redraw in the correct order. Other controls can draw immediately on the front panel when they receive new data from the block diagram. More overhead is involved in invalidating and redrawing, most (but not all) of which shows up in the Draw timings.
- Tracking—Time spent tracking user operation, including time spent tracking the mouse while the user interacts with the front panel of the VI. This can be significant for some kinds of operations, such as zooming in or out of a graph, selecting items from a shortcut menu, or selecting and typing text in a control.
- Locals—Time spent reading or writing local variables. This time can sometimes be significant, especially when it involves large, complex data.
- Time unit—Unit of time LabVIEW uses to calculate the results in Profile Data.
- Profile memory usage—Gathers memory statistics while profiling. However, memory profiling substantially slows down the execution speed. You can place a checkmark in this checkbox only when profiling is stopped.
- Memory usage—Displays statistics about the number of bytes and the number of independent memory blocks that a VI uses. The number of bytes indicates the total memory usage of the VI. The number of blocks indicates the number of independent contiguous sections of memory that are still allocated for the VI after the VI finishes running. The byte statistics are much more useful than the block statistics for understanding the current memory usage of the VI and evaluating changes between profiles.
This section displays the following details about memory usage:
You can choose the size format in the Size unit pull-down menu.
- Avg Bytes—Average number of bytes used by the data space of the VI per run.
- Min Bytes—Minimum number of bytes used by the data space of the VI for an individual run.
- Max Bytes—Maximum number of bytes used by the data space of the VI for an individual run.
- Avg Blocks—Average number of blocks used by the data space of the VI per run.
- Min Blocks—Minimum number of blocks used by the data space of the VI for an individual run.
- Max Blocks—Maximum number of blocks used by the data space of the VI for an individual run.
To reduce the memory usage of a VI, follow the rules for better memory usage in LabVIEW. You can also evaluate whether to redesign the VI to make fewer copies of data. Use the Show Buffer Allocations window to identify where LabVIEW might create copies of data.
- Size unit—Unit of size (bytes, kilobytes, or megabytes) LabVIEW uses to calculate the results in Profile Data. A kilobyte represents 1000 bytes. A megabyte represents 1,000,000 bytes.
- Select Application Instances—Launches the Select Application Instances dialog box. Use this dialog box to select the application instances for which the Profile Performance and Memory window displays data.
- Application Instances—Shows each application instance accessed by the Profile Performance and Memory window and the color LabVIEW uses to represent it.
- Profile Data—Displays the current snapshot of profile data. Click the row to select a VI row. Press the <Shift> key and click the row to remove highlighting of the row. Double-click the VI row to access information about the subVIs that a selected VI calls. Click the column header or the cell in the upper left corner to sort data by column or VI name. The basic information that is always visible in the first three columns of the tabular display consists of the following items:
- VI Time—Total time spent actually executing the code of the VI and displaying its data, as well as time spent by the user interacting with any front panel controls. For global VIs, this time is the total amount of time spent copying data to or from all of its controls. Double-click the name of the global VI to view timing information for individual controls.
- SubVIs Time—Total time spent by all subVIs of the VI. This is the sum of VI Time for all callees of the VI, as well as their callees, and so on.
- Total Time—Sum of VI Time and SubVIs Time, calculating the total amount of time.
- Project Library—If the VI you are profiling belongs to a project library, that library is included in the tabular display.
- Start—Starts profiling. When you click this button, LabVIEW allocates profiling structures and the execution system starts gathering timing information. It is best to start a profiling session while your application is not running to ensure that you measure only complete runs of VIs, and not partial runs.
- Stop—Stops profiling. When you click this button, the execution system stops gathering timing information, and LabVIEW retains the last snapshot.
- Snapshot—Gathers profile times for all the VIs in memory of the current execution system so you can view the data currently available in the tabular display.
- Save—Saves the currently displayed data to disk as a tab-delimited text spreadsheet file. This data can then be viewed in a spreadsheet program or by VIs.
- Close—Closes the Profile Performance and Memory window.