• 2023
  • 12/16/2022
  • Public Content

Profiling Games built with Unity* (NEW)

Use this recipe to profile a game built with the Unity game engine. See how you can run
Intel® VTune™
within the Unity environment to profile your game.
Often, the most important factor that affects the performance of a game is the frame rate. This is the speed with which the GPU renders game graphics. However, the CPU can also impact game performance in several ways:
  • Slow transfer of data to the GPU
  • Slow or unnecessary operations
  • Poor parallelism
With games that use the Unity engine, much of the optimization takes place in the Unity editor. Therefore, it is critical to understand the performance of Unity-defined tasks. The 2019.2 and newer versions of Unity have the
Intel® VTune™
Instrumentation and Tracing Technology (ITT) API built into the Unity editor. This recipe demonstrates how you can run
VTune Profiler
to highlight Unity tasks in the editor.


Here are the hardware and software requirements for this performance recipe.
  • Application
    Unity 2022.1.16
    . The sample game in this version of Unity uses the free asset 3D Game Kit.
  • Tools
    Intel® VTune™
    version 2022 - Hotspots Analysis (using User-Mode Sampling)
    • Starting with the 2020 release, Intel® VTune™ Amplifier has been renamed to
      Intel® VTune™
    • Most recipes in the
      Intel® VTune™
      Performance Analysis Cookbook are flexible. You can apply them to different versions of
      Intel® VTune™
      . In some cases, minor adjustments may be required.
    • Get the latest version of
      Intel® VTune™
    : Intel® Core™ i7-8665U CPU @ 1.90GHz with integrated GPU
  • Operating system
    : Windows* 10 Enterprise

Build the Game in the Unity Editor

  1. Open the game in the Unity editor.
    Open game in Unity Editor
  2. Build the game. Make sure to select the
    Copy PDB Files
    Development Build
    Build the game

Intel® VTune™
and Run Hotspots Analysis

  1. Open
    Intel® VTune™
    and click
    New Project
    on the Welcome screen.
  2. Specify a project name and a location for your project.
  3. Click
    Create Project
  4. In the
    Configure Analysis
    window, set these options:
    • In the
      pane, select
      Local Host
    • In the
      field of the
      pane, enter the path to the game executable.
    • In the
      Application parameters
      field, enter
    Configure VTune Profiler for game profiling
  5. (Optional) If you want to skip profiling the start/loading phase of the game,
    • In the
      pane, open the
    • Set
      Automatically resume collection after
      to the number of seconds that
      Intel® VTune™
      should wait for profiling to begin.
    Configure Advanced Options
  6. In the
    pane, select the
    Hotspots analysis type
    and enable user-mode sampling.
  7. Click
    to run the analysis.
Configure Hotspots Analysis
If you set the
Automatically resume collection after
option in step 5, only the
Start Paused
button () is available.

Review Results

After the data collection runs for about 30 seconds, click
to exit the game and finalize the VTune results. This process may take a few minutes as
Intel® VTune™
finds and resolves debug symbols.
Once results have been finalized, the
tab displays information about:
  • Elapsed time
  • Top hotspots
  • Top Unity tasks
  • Additional insights and guidance
Summary Tab of Hotspots Analysis
Frame Rate Histogram
shows the frequency at which frames executed during the collection.
Frame Rate Histogram
In this example, most frames executed between 13-14 frames per second (FPS). This is much slower than the recommended minimum of 30 FPS.
Switch to the
window to see a list of functions. The default sorting is by descending order of CPU time.
Change the grouping from
Function / Call Stack
Task Domain / Task Type / Function / Call Stack
to focus on Unity tasks which were identified by the
Intel® VTune™
Instrumentation and Tracing Technology API (ITT API).
Bottom-Up Tab with Unity functions
The collection was started in a paused state, and this is indicated in the timeline view as
Intel® VTune™
was still actively running.
Select the time period when collection starts at 60 seconds and zoom in.
Timeline View
In this example, the frame rate is low and there is considerable spin time. In general, a game should not consume a high percentage of the CPU capacity of the system. If the worker threads have low parallelism, they may be adding too much overhead.
In one of the
threads, all of the CPU time is spin or overhead. Reducing the number of threads can improve performance here.
RunThreadWrapper thread
For additional insights into hotspots, open the
Flame Graph
view to see a graphical representation of call stacks from the top down.
Flame Graph View

Product and Performance Information


Performance varies by use, configuration and other factors. Learn more at