Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use sys.monitoring (PEP-669) for reduced overhead in the explain phase on Python 3.12+ #3773

Closed
Zac-HD opened this issue Oct 21, 2023 · 0 comments · Fixed by #3776
Closed
Labels
performance go faster! use less memory!

Comments

@Zac-HD
Copy link
Member

Zac-HD commented Oct 21, 2023

As part of the explain phase, codenamed Scrutineer, we collect and analyze coverage information. This currently uses Python's sys.settrace() functionality, which provides hooks on which coverage analysis (or debuggers) can be implemented - at the cost of some performance overhead. From Python 3.12, PEP-669 offers a lower-overhead alternative in the sys.monitoring module.

Reimplementing the data-collection logic of Scrutineer using this new API offers us a basically free performance boost - so while the implementation might be tricky and it's not a huge priority while so few people have dropped older Python versions, I'm keen!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance go faster! use less memory!
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant