Profiling in Unity 2022 LTS - Resources to help you get started

Hey everyone,

Developing expertise with Unity’s suite of profiling tools is one of the most useful skills you can add to your game development toolbox. Thorough profiling can massively boost the performance of your game, so we wanted to share a reading list of resources for anyone interested in learning about profiling Unity projects.

To achieve smooth performance, you need to profile your game. Profiling tools help you understand what’s going on “under the hood” of your Unity project. Not only do you need to know what tools to use, and how, but when to use them. While Unity offers multiple tools for optimization, there are three profiling tools which are great additions to your developer toolbelt.

Let’s start with a quick summary of how you can leverage each of them in your game development process.

Unity Profiler

The Unity Profiler is where you want to kick off your optimization process and most likely spend most of your time. It measures the performance of the Unity Editor, your application in Play mode, and connects to the device running your application in Development mode. The Unity Profiler gathers and displays data on the performance of your application, such as how much CPU time is being used for different tasks, from audio and physics to rendering and animation.

Unity Profiler is part of the Unity Editor, and it comes with a low-level native plug-in Profiler API so you can customize your analysis and export profiling data to other tools.

Check out the video tutorial below where you’ll learn more about profiling your game to identify bottlenecks, the Unity Profiler’s interface, and how to identify issues that need fixing.

Memory Profiler

The Unity Memory Profiler gives you insights into memory performance, and it helps you identify where you can reduce memory usage in parts of your project and the Editor. It helps you test against hardware memory constraints and enhances CPU/GPU performance by strategically managing memory usage.

The Memory Profiler is available as a package that you can add to the Editor window, so you can see memory usage in your application in even greater detail. Features include the ability to capture and compare snapshots for pinpointing memory leaks, as well as visualizing memory layout to identify and address memory fragmentation issues.

The walkthrough tutorial below about the Memory Profiler covers how to capture snapshots in the Editor and standalone builds, and reading and comparing memory usage data.

Profile Analyzer

The Profile Analyzer aggregates and visualizes both frame and marker data from a set of Unity Profiler frames to help you examine their behavior over many frames (complementing the single-frame analysis already available in the Unity Profiler). It also allows you to compare two profiling datasets to determine how your changes impact the application’s performance.

In our new video series, we also look at an overview of the Profiler Analyzer in Unity 2022 LTS. You’ll learn more about pulling data into the Profile Analyzer, and how to save, load, read, filter, and compare it.

Understanding the workflows of profiling

Understanding the tools is key but knowing when to use them is equally important. A classic mistake is profiling as your project is close to completion. However, the best gains from profiling are made when you plan early on in your project’s development lifecycle, rather than just before you are about to ship your game. It’s an ongoing, proactive, and iterative process. By profiling early and often, you and your team can understand and establish a “performance signature” for the project. If performance takes a nosedive, for instance, you’ll be able to easily spot when things go wrong, and quickly remedy the issue.

Use the following high-level overview as a reference sheet to help you define a strategy for how and where to prioritize your optimization efforts.

If you are interested in a breakdown of each of these steps and learning more about the tactics for optimizing and profiling your games, check out our blog post Profiling in Unity 2021 LTS: What, when, and how and e-book, Ultimate guide to profiling Unity games. You’ll get more than 80 pages of tips and tricks created in partnership with multiple experts, including those on our Integrated Support services team.

Ultimate guide to profiling e-book

Diving into the specifics of performance optimization

Finally, if you are looking for actionable tips on how to boost your games performance heck out our two guides on mobile and PC and console performance optimization covered in our Discussions article.

Each guide includes actionable tips across profiling tools, programming and code architecture, working with assets, render pipelines, UI, and much more. There are also many new and updated links to additional documentation and other resources if you want to go deeper and the guides are packed with practical tips from both Unity engineers and game studios.

We hope you find these resources and profiling and performance optimization useful. If you have any feedback, as usual, please let us know in the comments.

Happy reading!