-
-
Notifications
You must be signed in to change notification settings - Fork 433
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
COVERAGE_CORE=sysmon with branch coverage can be 2x slower than default in some cases #1812
Comments
Yes, the sysmon support is not yet in place to do a good job with branch coverage. I could add a warning to that effect if it would help. |
Thanks for your answer, I guess this was more of a "is this expected" question than a call for action. I am not sure whether a warning would be that useful, in particular because in our use case we use coverage via pytest-cov and I think pytest would capture the warning which would kind of hide it amongst a number of other warnings that happened when we run our tests. |
Another option: refuse to run with |
Why not error indeed. I guess it would make sense to do this if you think that in a vast majority of cases the performance will be worse using |
In my case, we did see a (moderate) improvement in performance when setting |
Describe the bug
Using
COVERAGE_CORE=sysmon
with branch coverage can be 2x slower than default. Note the 2x likely depends on the code whose coverage is measured. Trying different variations of the Python snippet below I have seen vary from ~20% to 2x degradation roughly.To Reproduce
Python script:
Script to run:
I read the other performance issues with coverage and Python 3.12 for example #1665 and python/cpython#107674 and this seems like a slightly different issue. This may be related to the fact that only statement coverage is using sysmon and not branch coverage according to #1746 (comment) but I still find the performance degradation somewhat surprising.
How can we reproduce the problem? Please be specific. Don't link to a failing CI job. Answer the questions below:
coverage debug sys
is helpful.pip freeze
is helpful.Expected behavior
Usins
COVERAGE_CORE=sysmon
improves performance and in the worst case may not improve it much but at least does not degrade itAdditional context
We originally saw this in the scikit-learn CI scikit-learn/scikit-learn#29444 (comment).
The text was updated successfully, but these errors were encountered: