跳到正文
原文
Simon Willison·· 2026-10-13AI 评分26

Python 3.15 profiling.sampling 对 web-edit 应用的性能剖析

Profiling web-edit with Python 3.15: flame graphs and source heatmaps

AI 导读

Python 3.15 内置 `profiling.sampling` 剖析显示,web-edit 应用中 `preserve_endings` 占 CPU 栈的 64.8%,其中 `SequenceMatcher.find_longest_match` 贡献了 38.3% 的叶子样本。由于 95.1% 的栈来自 AnyIO 工作线程,必须采样所有线程才能捕获完整性能数据。

来源:Simon Willison · simonwillison.net