火焰图 (FlameGraph)

Travis status Swift Package Manager

开发中

一个从 Xcode Instruments 跟踪文件生成火焰图的命令行工具

一个关于 Wikipedia iOS App 的 -[AppDelegate application:didFinishLaunchingWithOptions:] 方法的火焰图示例:示例输出

安装

Mint

$ mint install lennet/FlameGraph

Swift Package Manager (Swift 包管理器)

$ git clone https://github.com/lennet/FlameGraph.git
$ cd FlameGraph
$ swift run FlameGraph <args>

用法

  1. 在 Instruments 中运行 Time Profiler (时间分析器)
  2. 选择您感兴趣的线程和区域
  3. 编辑 > 深度复制 ⇧⌘C
  4. $ FlameGraph <OutputPath.pdf>