美文网首页日常知识点收集
Xcode instruments 之 Time Profile

Xcode instruments 之 Time Profile

作者: Superman168 | 来源:发表于2018-10-20 14:44 被阅读0次

1、我们要先 command + shift +k ,clean下
2、运行下app,command + r
3、Xcode–> Product–> Profile (command + i 快捷键)调出instrument,选择Time Profiler,我们可以跟踪哪个方法最耗时间,以此来优化

image.png

注意:我们看下有下角的☑️选项,对于我们很有帮组

Separate by Thread:按线程分开做分析,这样更容易揪出那些吃资源的问题线程。特别是对于主线程,它要处理和渲染所有的接口数据,一旦受到阻塞,程序必然卡顿或停止响应。
Invert Call Tree:反向输出调用树。把调用层级最深的方法显示在最上面,更容易找到最耗时的操作。
Hide System Libraries:隐藏系统库文件。过滤掉各种系统调用,只显示自己的代码调用。
Flattern Recursion:拼合递归。将同一递归函数产生的多条堆栈(因为递归函数会调用自己)合并为一条。
Top Functions:找到最耗时的函数或方法。

相关文章

网友评论

    本文标题:Xcode instruments 之 Time Profile

    本文链接:https://www.haomeiwen.com/subject/pkohkftx.html