官术网_书友最值得收藏!

Targeted profiling of code segments

If our performance problem isn't resolved by the checklist mentioned previously, then we probably have a real issue on our hands that demands further analysis. The Profiler window is effective at showing us a broad overview of performance; it can help us find specific frames to investigate and can quickly inform us which MonoBehaviour and/or method may be causing issues. We would then need to figure out whether the problem is reproducible, under what circumstances a performance bottleneck arises, and from where exactly within the problematic code block the issue is originating.

To accomplish these, we will need to perform some profiling of targeted sections of our code, and there are a handful of useful techniques we can employ for this task. For Unity projects, they essentially fit into two categories:

  • Controlling the Profiler from script code
  • Custom timing and logging methods
Note that the next section focuses on how to investigate scripting bottlenecks through C# code. Detecting the source of bottlenecks in other engine subsystems will be discussed in their related chapters.
主站蜘蛛池模板: 白玉县| 花莲市| 佛山市| 图片| 靖江市| 新田县| 马尔康县| 正镶白旗| 临江市| 民权县| 余干县| 东台市| 翼城县| 松原市| 都兰县| 东台市| 集安市| 西贡区| 山丹县| 施秉县| 饶平县| 清流县| 安阳县| 东阿县| 文化| 天门市| 凤城市| 阜康市| 平顶山市| 左权县| 关岭| 德庆县| 台湾省| 浮梁县| 容城县| 同心县| 阳高县| 婺源县| 会泽县| 钟祥市| 海丰县|