getsentry / getsentry/sentry-python

Investigate profiling with sys.monitoring/PEP 669

未关闭
#2,683 3 条评论 3 个 reaction 已指派 0 人 在 GitHub 查看
Feature Profiles Python
主要语言
Python
星标
2.2k
派生
669
平均合并
1 天 1 小时
30 天内合并 PR
213

描述

### Problem Statement

Sentry's built-in profiling is reasonably low-overhead, but it takes a snapshot of the app's stack every ~10ms. This can miss quite a lot of events. Before Python 3.12, implementing a more comprehensive profiler would tank performance and was absolutely cost-prohibitive in production.

### Solution Brainstorm

But since 3.12 we have [PEP 669](https://peps.python.org/pep-0669/) and [sys.monitoring](https://docs.python.org/3/library/sys.monitoring.html), a low(er)-overhead method of getting access to interpreter events. These allow informing a profiler whenever a new interpreter event happens in process. It'd be nice to investigate if this could be used for more granular Python profiling.

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。