// 一些C/C++优化工具
#import "/template.typ":*
#doc-template(
title: "一些C/C++优化工具",
date: "2021年11月13日",
body: [
= 性能数据收集
== perf
Linux下收集性能数据通常用perf。关于perf的使用可以参考#link("https://www.brendangregg.com/perf.html")[Brendan Gregg的网站]。
其中最常用的命令是perf record和perf report,而常用的指标有cycles、branch miss、cache miss等。
然后用#link("https://github.com/brendangregg/FlameGraph")[FlameGraph工具]可以生成火焰图,直观显示性能消耗在何处。
== perf的原理
收集cycles、branch miss、cache miss这些数据,主要应用到了CPU当
...
Email: i (at) mistivia (dot) com