JetBrains Rider 2024.1 Help

Profile Unity Applications

JetBrains Rider comes bundled with dotTrace performance profiler that allows finding performance bottlenecks in your Unity games. This includes finding the slowest methods in your scripts, determining the cause of CPU starvation, blocking garbage collection, disk I/O, and other issues. The integrated profiler is based on JetBrains dotTrace and is compatible with Unity 2018.3 and later. You can use the profiler via the dotTrace Profiler tool window. For more information about the integrated profiler, refer to Performance profiling of .NET code.

Installation and licensing

dotTrace and dotMemory are provided as a single bundled plugin for JetBrains Rider, which is added and enabled automatically during the IDE installation. If you want to disable the plugin, open the Plugins page of the IDE settings  Ctrl+Alt+S, switch to the Installed tab and clear the checkbox next to dotTrace and dotMemory.

Note that the dotTrace and dotMemory plugin is available in Rider only for the owners of dotUltimate or All Products Pack subscriptions.

There are two ways to profile a Unity application:

  • Profile a project opened in the Unity Editor and Rider.

  • Profile a compiled Unity application executable file.

Profile a project opened in the Unity Editor and Rider

  1. Close the Unity Editor if it is open.

  2. In Rider, on the toolbar, choose a run configuration: either Attach to Unity Editor or Attach to Unity Editor and Play.

  3. From the menu bar, choose Run | Profile {run-configuration} with Timeline (Unity).

    On Windows, you can also profile the native part of your Unity application. To do this, you should select the Enable native profiling option in the profiling configuration settings. This option may be helpful for finding low-level performance issues related to rendering and other Unity engine subsystems.

    Unity profiling config
  4. Reproduce the performance issue you are looking for or, if you just evaluate the overall app performance, go through the desired usage scenarios in your application.

  5. Click Get Performance Snapshot Rider Get Snapshot. The collected snapshot will be added to the list of snapshots inside the dotTrace Profiler window. To start collecting profiling data again, click Start Recording Start Recording.

  6. After you collect a snapshot(s), you can finish the profiling session. Normally, you do it either by closing the profiled application or using the Kill processes Kill button (it forcibly terminates the profiled app and the session, so, use it only in emergency cases).

  7. Analyze the collected snapshots.

Profile an executable file of a Unity app

  1. Create a new run configuration based on Unity Executable. Important: If you want to profile the Unity Editor executable, specify the project path in Arguments, for example, -projectpath "C:\MyUnityProject".

  2. Select this run configuration on the toolbar.

  3. From the menu bar, choose Run | Profile {run-configuration} with Timeline (Unity).

    On Windows, you can also profile the native part of your Unity application. To do this, you should select the Enable native profiling option in the profiling configuration settings. This option may be helpful for finding low-level performance issues related to rendering and other Unity engine subsystems.

  4. Run profiling by clicking the Profile Unity app Run 'your_config' with 'Timeline (Unity)' button on the toolbar.

  5. Reproduce the performance issue you are looking for or, if you just evaluate the overall app performance, go through the desired usage scenarios in your application.

  6. Click Get Performance Snapshot Rider Get Snapshot. The collected snapshot will be added to the list of snapshots inside the dotTrace Profiler window. To start collecting profiling data again, click Start Recording Start Recording.

  7. After you collect a snapshot(s), you can finish the profiling session. Normally, you do it either by closing the profiled application or using the Kill processes Kill button (it forcibly terminates the profiled app and the session, so, use it only in emergency cases).

  8. Analyze the collected snapshots.

Last modified: 11 February 2024