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

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.
主站蜘蛛池模板: 乐东| 安远县| 孟津县| 吉木萨尔县| 嘉鱼县| 芦山县| 陆河县| 浦城县| 故城县| 石泉县| 连山| 桐梓县| 弋阳县| 北京市| 潜山县| 宝鸡市| 清苑县| 眉山市| 响水县| 外汇| 泗水县| 西乡县| 常熟市| 长宁县| 荆门市| 安远县| 肥东县| 石阡县| 峡江县| 竹山县| 陕西省| 昆明市| 碌曲县| 康马县| 景泰县| 乐亭县| 二连浩特市| 睢宁县| 沙雅县| 遂川县| 宁陵县|