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

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 where exactly within the problematic code block the issue is originating from.

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.

主站蜘蛛池模板: 忻州市| 汕头市| 辉南县| 沙雅县| 习水县| 衡阳市| 永安市| 乌兰察布市| 原平市| 陆川县| 泊头市| 德江县| 应用必备| 那坡县| 河北省| 竹山县| 鄂托克旗| 尼木县| 奉化市| 饶平县| 孝昌县| 都安| 诏安县| 永平县| 瑞金市| 辉南县| 沂源县| 莱西市| 四川省| 报价| 满洲里市| 绍兴市| 宿州市| 荣成市| 金山区| 崇明县| 科尔| 元氏县| 库车县| 南岸区| 兴业县|