按年被提到
20162020 · 2 次2026
安全、隐私与密码学›调试、模糊测试与供应链·arXiv:1608.03676 · cs.PF

Coz: Finding Code that Counts with Causal Profiling

Coz:用因果剖析找出真正重要的代码
Charlie Curtsinger, Emery D. Berger · 2016

因果剖析:通过虚拟加速代码,找出真正影响性能的代码行

开始阅读 ↗PDFalphaXiv 讨论
被推荐 · 3 人首次 2020-02-24 · 最近 2025-01-24发表于 ACM SIGOPS Symposium on Operating Systems Principles (SOSP)
3不同的人
3活跃月份
3讨论串
104被引(OpenAlex)

传统性能剖析器只告诉你时间花在哪,但优化那段代码未必能提速。这篇论文提出因果剖析(causal profiling):在程序运行时做性能实验,通过让其他并发代码暂停来“虚拟加速”某段代码,从而量化优化它的潜在收益。基于此实现的 Coz 在 Memcached、SQLite 和 PARSEC 上发现了新的优化机会,Memcached 提速 9%、SQLite 提速 25%,多数情况只需改动不到 10 行代码。

HN 为什么提它

评论者既推荐“注入减速来测各部分对性能影响”这一思路,也引用它在 SQLite、memcached 上的提升,另有人批评因果剖析在实践中用处有限。

方法难度 3 / 5约 50 分钟经得起时间
读之前最好知道
1性能剖析器(profiler)基础
2并发编程与多线程
3性能实验与测量方法
4C/C++ 程序运行机制

HN 书评

推荐在前,同类按时间 · 每篇最多保留 20 条,统计用全部提及
推荐sitkack · 2025-01

“If you enjoy the science of injecting slowness to determine which component has the largest impact on performance, you would enjoy this work by Emery Berger.”

推荐这项工作,适合喜欢用注入慢速判断组件性能影响的人
Disabling Zen 5's Op Cache and Exploring Its Clustered Decoder原评论 ↗
批评moonchild · 2020-06

“Even something like a causal profiler[2][3][4], which attempts to control for the volatile aspects of performance, is of limited use”

C performance mystery: delete unused string constant原评论 ↗
引用vlovich123 · 2020-02

“However, better tooling still managed to locate 25% of performance improvement[2] & even 9% in memcached.”

拿它说明更好的工具能找到 25% 的性能提升,memcached 上也有 9%
Reflections on Software Performance原评论 ↗