Skip to content

Investigate profiling with sys.monitoring/PEP 669 #2683

Open
@DragoonAethis

Description

@DragoonAethis

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 and sys.monitoring, 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions