Introduction to Perftools
· 4 min read
Perftools是Google推出的一款CPU Profile及内存、堆栈分析工具。 本文将主要介绍其中的CPU Profile。
gperftools工具还可以生成火焰图🔥,火焰图十分方便找出程序的性能瓶颈。
此外,需要注意区分两个项目: https://github.com/google/pprof, https://github.com/gperftools/gperftools, 前者主要面向go的, C++的项目用会存在一些问题(如函数名显示"__ZN14ItlRatesSolver6deltaEER7LatticeS1_N12LatticeTypes8lat_typeE"),C++项目用后者。
安装 perftools
homebrew 安装
brew install perftools