Tools for profiling and debugging

Every game creator knows that smooth performance is essential to creating immersive gaming experiences – and to achieve that, you need to profile your game. 

Get an overview of the profiling and debugging tools available with Unity and those available for target platforms.

The information here is excerpted from the e-book, Ultimate guide to profiling Unity games, available to download for free. The e-book was created by both external and internal Unity experts in game development, profiling, and optimization.

Unity와 네이티브 툴을 모두 사용하여 최고의 성과를 창출할 수 있습니다.

Unity 메모리 프로파일러 모듈을 사용하여 프로젝트에서 에셋 및 씬 오브젝트 메모리 할당 관련 정보를 신속하게 수집할 수 있습니다.

Use both Unity and native tools for the best results

Profiling is like detective work, unraveling the mysteries of why performance in your application is lagging, or why code is allocating excess memory. The best gains from profiling are made when you plan early on in your project’s development lifecycle. It’s an ongoing proactive and iterative process. By profiling early and often, rather than just before you are about to ship your game, 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.

The most accurate profiling results come from running and profiling builds on target devices, as well as using platform-specific tooling to dig into the hardware characteristics of each targeted platform.

Unity ships with a range of free and powerful profiling tools for analyzing and optimizing your code, both in-Editor and on hardware. There are also several great native profiling tools designed for each target platform, such as those available from Arm, Apple, Sony, and Microsoft. Using a combination of both provides a more holistic view of application performance across all target devices.

Unity profiling tools

Using the Frame Debugger to analyze how identified overdraw occurs

Unity profiling tools

Unity’s profiling tools are available in the Editor and the Package Manager. Each tool specializes in profiling various parts of your project:

  • The Unity Profiler helps you measure project performance and identify which processes could be causing problems. The Profiler gathers and displays data, such as how much CPU time is being used for different tasks, from audio and physics to rendering and animation. It measures the performance of the Unity Editor, your application in Play mode, and connects to the device running your application in Development mode. Use this essential tool to start profiling. Check out this course on profiling to begin.
  • The Memory Profiler provides an in-depth analysis of memory performance. Reducing memory usage will help you reduce crashes, decrease loading time, and make your project compatible with older devices. The Memory Profiler is currently in preview but is expected to be verified in Unity 2022 LTS.
  • 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. (This complements 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.
  • The Frame Debugger lets you freeze playback for a running game on a particular frame, and then view the individual draw calls used to render that frame. In addition to listing the draw calls, the debugger lets you step through them one at a time, so you can see how the scene is constructed from its graphical elements.
  • The Profiling Core package provides APIs for adding contextual information to Unity Profiler captures.
네이티브 프로파일링 툴

Arm의 Streamline 성능 분석기에는 대상 Arm 하드웨어에서 라이브 프로파일링 세션 동안 캡처할 수 있는 풍부한 성능 카운터 정보가 포함되어 있습니다.

Native profiling tools

Android / Arm

  • Android Studio: The latest Android Studio includes a new Android Profiler that replaces the previous Android Monitor tools. Use it to gather real-time data about hardware resources on Android devices.
  • Arm Mobile Studio: A suite of tools to help you profile and debug your games in great detail, catered for devices running Arm hardware.
  • Snapdragon Profiler: Specifically for Snapdragon chipset devices only. Analyze CPU, GPU, DSP, memory, power, thermal, and network data to help find and fix performance bottlenecks.

Intel

  • Intel VTune: Quickly find and fix performance bottlenecks on Intel platforms with this suite of tools. For Intel processors only.
  • Intel GPA suite: A suite of graphics focused tools to help you improve your game’s performance by quickly identifying problem areas.

Xbox / Windows

  • PIX: PIX is a performance tuning and debugging tool for Windows and Xbox game developers using DirectX 12. It includes tools for understanding and analyzing CPU and GPU performance as well as monitoring various real-time performance counters. For more information on leveraging PIX for Xbox game development, register as an Xbox developer.

PC / Universal

  • AMD μProf: AMD uProf is a performance analysis tool for understanding and profiling performance for applications running on AMD hardware.
  • NVIDIA NSight: Tooling that enables developers to build, debug, profile, and develop class-leading and cutting-edge software using the latest visual computing hardware from NVIDIA.
  • Superluminal: Superluminal is a high-performance, high-frequency profiler that supports profiling applications on Windows, Xbox One, and PlayStation written in C++, Rust and .NET. It is a paid product, though, and must be licensed to be used.

PlayStation

iOS

WebGL

  • Firefox Profiler: Dig into the call stacks and view flame graphs for Unity WebGL builds (among other things) with the Firefox Profiler. It also features a comparison tool to look at profiling captures side by side.
  • Chrome DevTools Performance: Another web browser tool that can be used to profile Unity WebGL builds.

GPU debugging and profiling tools

While the Unity Frame Debugger tool captures and illustrates draw calls that are sent from the CPU, the following tools can help show you what the GPU does when it receives those commands.

Some are platform-specific and offer closer platform integration. Take a look at the tools relevant to the platforms of interest:

Want to learn more?

Download the e-book, Ultimate guide to profiling Unity games, for free to get all the tips and best practices.

Was this content helpful?

Unity에서는 최적의 웹사이트 경험을 제공하기 위해 쿠키를 사용합니다. 자세한 내용은 쿠키 정책 페이지를 참조하세요.

확인