Version: 2021.1
分析
Profiling your application

Profiler overview

Unity 性能分析器 (Unity Profiler) 是一种可以用来获取应用程序性能信息的工具。可以将性能分析器连接到网络中的设备或连接到已连接到计算机的设备,从而测试应用程序在目标发布平台上的运行情况。还可以在 Editor 中运行性能分析器,从而在开发应用程序时概要了解资源分配情况。

The Profiler gathers and displays data on the performance of your application in areas such as the CPU, memory, renderer, and audio. It’s a useful tool to identify areas for performance improvement in your application, and iterate on those areas. You can pinpoint things like how your code, assets, scene settings, camera rendering, and build settings affect your application’s performance. It displays the results in a series of charts, so you can visualize where spikes in your application’s performance happen.

In addition to using the built-in Unity Profiler, you can use the low level native plug-in Profiler API to export profiling data to third-party profiling tools, and the Profiling Core package to customize your profiling analysis. You can also add powerful profiling tools such as the Memory Profiler, and the Profile Analyzer to your project to analyze performance data in further detail.

要访问 Profiler 窗口,请选择菜单:__Window > Analysis > Profiler__。有关该窗口的详细概述,请参阅 Profiler 窗口文档。

本节涵盖以下主题:

How to profile and optimize your application

有关如何对应用程序进行性能分析的最佳做法信息以及可以通过性能分析来调整哪些方面,请参阅以下指南和教程:

分析
Profiling your application