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

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.
主站蜘蛛池模板: 高台县| 阳高县| 怀来县| 徐州市| 海城市| 景泰县| 麻江县| 广南县| 三亚市| 神农架林区| 手游| 新余市| 阳谷县| 巴彦淖尔市| 文安县| 安康市| 全南县| 平舆县| 苏州市| 盐边县| 太康县| 廊坊市| 平邑县| 清苑县| 邛崃市| 宽甸| 九龙坡区| 邵武市| 拉孜县| 乌拉特中旗| 汝南县| 郯城县| 威宁| 南靖县| 胶州市| 遂平县| 淮滨县| 应城市| 龙泉市| 牙克石市| 阿拉善盟|