Q100225: Profiling your Nuke script to isolate performance issues



This article explains two alternative methods that can be used to test the performance of Nuke nodes when trying to identify the cause of script slowdowns.


Trying to find out which parts of your Nuke script that are slowing down your playback/render times can be difficult.

To facilitate this process, Nuke provides two alternative methods to profile the performance of nodes in your script, Performance Profiling mode and the Profile node.
Both methods will provide analytics that can be used to isolate particularly slow nodes and help you optimize your workflow. When profiled, nodes with be color-coded from green through red, where red is a slow node.
You can see from the example below that Defocus is a slow node, whereas Merge is doing no work at all.

Performance Profiling mode

Performance Profiling mode when set, will allow you to see the analytics of each node and various metrics on the node itself.
Launching Nuke in Performance Profiling mode

To run Nuke in Performance Profiling mode you need to use the -P flag when launching Nuke. A list of instruction on how to do this can be found below for each operating system. 
Open a Command Prompt window and run the following command:

"C:\Program Files\Nuke14.0v5\Nuke14.0.exe" -P

Open a Terminal window from Applications > Utilities and run the following command:

/Applications/Nuke14.0v5/Nuke14.0v5.app/Contents/MacOS/Nuke14.0 -P
Open a terminal and run the command:

/usr/local/Nuke14.0v5/Nuke14.0 -P

Note: These instructions are based on having Nuke installed in the default location. If this is not the case then the commands will need to be modified accordingly to run from your custom installation location.
Information reported while in Performance Profiling mode
With Nuke launched in Performance Profiling mode, each node will report the following information:
CPU - The time that the CPU spent executing the processing code, in microseconds, aggregated over all CPU threads.
For example, with multi-threaded processing this is typically much larger than the wall time. If the average CPU time per thread (CPU divided by the number of threads used) is much shorter than the wall time, this suggests the CPU threads have spent a lot of time not executing code and perhaps waiting on locks, which could indicate a performance problem.

NOTE: On macOS and Windows, the CPU time is not currently accurate. On macOS, the CPU value is always similar to the wall time.

wall - The time taken as it would be measured by a clock on the wall - the actual time you have to wait for the processing to complete. The wall time is also measured in microseconds.

ops - The number of operators called in the node. Operators are Nuke's building blocks that perform certain tasks. Nodes can contain one or more ops.
For example, when a node needs to resize something it would use a Transform op rather than an implementation of its own to do the same thing.

memory - The total amount of system memory used by the node.
With Nuke launched in Performance Profiling mode, you can reset, start and stop the timers in the Performance menu in the Nuke UI, as shown below:

Profile node

Within Nuke 11.1 releases (and later) we introduced the Profile node. This node allows users the ability to calculate the metrics of a node tree at the point the Profile node is placed.
When a Profile node is placed in the node graph and selected the Profile menu will open.
To run the profile, enter the selected frame range and data type then click, 'profile'.
Once the data is collected, within the Profile menu the data will be generated and shown in a chart based upon percentage use.
Note: For more information on filtering this data, please refer to the Filtering Profile Data documentation


Difference between methods

While the Profile node does provide quite a few new features such as charts and other GUI based diagnostics, it calculates performance based upon percent-based analytics rather than the timer-based analytics that the Performance Profile mode uses.

Additional Information
More information regarding both methods can be found respectively within either the Performance Profiling or Profile node documentation.

    We're sorry to hear that

    Please tell us why