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 PEP 669 Low Impact Monitoring to reduce overhead #1746

Open
intgr opened this issue Feb 9, 2024 · 3 comments
Open

Use PEP 669 Low Impact Monitoring to reduce overhead #1746

intgr opened this issue Feb 9, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@intgr
Copy link

intgr commented Feb 9, 2024

Is your feature request related to a problem? Please describe.
coveragepy adds significant overhead to test execution in CI.

And this got much worse with Python 3.12 due to CPython performance regression (#1665, python/cpython#107674, maybe will be fixed by python/cpython#107841)

Describe the solution you'd like
PEP 669 – Low Impact Monitoring for CPython (sys.monitoring) should be explored to see if it claws back lost performance or even results in performance gains. Though AFAIK it is not proven yet whether it will help.

Additional context
As I understand, this is already under development. But I wanted to open an issue anyway to track progress.
In #1665 (comment) (Oct 25, 2023) nedbat states:

I have started on code to use the new PEP 669 monitoring, but I haven't made much progress on it. I'd welcome help.

@intgr intgr added enhancement New feature or request needs triage labels Feb 9, 2024
@nedbat
Copy link
Owner

nedbat commented Feb 10, 2024

sys.monitoring support is in coverage.py 7.4.0, though it only makes line coverage faster, not branch coverage. I'm still working on the support that will be faster for branch coverage.

@intgr
Copy link
Author

intgr commented Feb 10, 2024

sys.monitoring support is in coverage.py 7.4.0

Awesome, thanks! I'll test COVERAGE_CORE=sysmon on monday. I was completely oblivious to that. I hadn't read the changelog and it wasn't mentioned in any of the threads that came up from my Google search.

@intgr
Copy link
Author

intgr commented Feb 12, 2024

Indeed COVERAGE_CORE=sysmon reduced test suite runtime by ~35%, compared to Python 3.12. That's ~20% faster than Python 3.11 even.

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

No branches or pull requests

2 participants