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

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.
主站蜘蛛池模板: 沙坪坝区| 民勤县| 彭州市| 禄丰县| 巍山| 抚宁县| 霍林郭勒市| 梓潼县| 株洲县| 鹤壁市| 平远县| 梁山县| 望都县| 宜川县| 溆浦县| 阿拉善盟| 通道| 恩施市| 新泰市| 巫溪县| 壶关县| 壤塘县| 大城县| 阳春市| 子洲县| 利辛县| 镇沅| 新乐市| 大丰市| 吉水县| 双桥区| 松滋市| 永城市| 云林县| 凤台县| 益阳市| 兴山县| 都昌县| 浠水县| 芦溪县| 沧州市|