Skip to content

perf(test): use Python’s system monitoring facilities to improve performance of test runs #933

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

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

jenstroeger
Copy link
Owner

Based on the Optimizing coverage with Python 3.12’s sys.monitoring blog section, this change almost doubles the performance of test runs (based on trying this change in three production repos).

@jenstroeger jenstroeger requested a review from behnazh as a code owner May 2, 2025 03:13
@@ -165,7 +165,7 @@ repos:
hooks:
- id: pytest
name: Run unit tests
entry: pytest -c pyproject.toml --cov-config pyproject.toml src/package/ tests/ docs/
entry: env COVERAGE_CORE=sysmon pytest -c pyproject.toml --cov-config pyproject.toml src/package/ tests/ docs/
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a comment based on the PR description to explain why COVERAGE_CORE=sysmon is necessary here, and also mention that this option is only recommended for Python version > 3.12.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commit 33a1209.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants