Skip to content

7.7.* degraded performance #1959

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
alexei opened this issue Apr 30, 2025 · 8 comments
Open

7.7.* degraded performance #1959

alexei opened this issue Apr 30, 2025 · 8 comments
Labels
bug Something isn't working

Comments

@alexei
Copy link

alexei commented Apr 30, 2025

I noticed our CI workflows have gotten slower lately. I did some investigations and found it happened on Apr 1st and so far I was able to isolate it to when we upgraded coverage from 7.6.12 to 7.8.0

In short, previously our tests took 10-15 min. now they take ~15-20 min:

Image Image

I think we have added 1.5% more tests in the past month, so I ran all the tests we have today in main under multiple versions of the coverage library:

Image

We use Python 3.12.7 and fwiw we run tests with COVERAGE_CORE=sysmon since Mar 2024.

I'd appreciate any suggestions in helping either me or you figure this out.

@alexei alexei added the bug Something isn't working label Apr 30, 2025
@nedbat
Copy link
Owner

nedbat commented Apr 30, 2025

The other factors are the same? Same version of Python? What are your coverage settings?

@alexei
Copy link
Author

alexei commented Apr 30, 2025

Thanks for the response!

The workflows in the screenshot differ in the coveragepy version only.

Config is:

[tool.coverage.run]
branch = true
source = ["."]

[tool.coverage.report]
omit = [
    "*/migrations/*",
]
skip_empty = true
fail_under=79
precision=2

@nedbat
Copy link
Owner

nedbat commented May 1, 2025

Using 3.12, you don't want COVERAGE_CORE=sysmon and branch=true. If you want branch coverage, use the default CTracer core. Branch coverage isn't fast until 3.14.

@alexei
Copy link
Author

alexei commented May 1, 2025

We've been using branch=true for at least 4 years.

On Mar 6, 2024 we upgraded to Python 3.12 and we found tests took ~45 min.

Then on Mar 18, 2024 we started using COVERAGE_CORE=sysmon and time went down to ~25 min.

Now you're suggesting to unset it. I'm a confused about this suggestion, but I'll set up branches to measure all combinations.

@nedbat
Copy link
Owner

nedbat commented May 1, 2025

It's not that branch=true is slow. It's branch=true combined with COVERAGE_CORE=sysmon on Python before 3.14. I recommend unsetting COVERAGE_CORE.

@miketheman
Copy link
Contributor

I've just found the same - and noted it here: pypi/warehouse#17872 (comment)
What's odd to me is that 7.6.12 works with sysmon, branch, and contexts, and is faster than ctrace.

@nedbat
Copy link
Owner

nedbat commented May 1, 2025

I have details and some suggestions on the other issue, but maybe I should have put it here...

@alexei
Copy link
Author

alexei commented May 5, 2025

I ran the workflows with different combinations both on Thursday:

Image

And today:

Image

(ignore the "failed" workflows - there's a flaky test that's not fixed in main)

It looks like on Python 3.12, so far, the fastest is either:

  • COVERAGE_CORE=sysmon and branch = false, with any coverage version;
  • or COVERAGE_CORE=sysmon and branch = true, with coverage==7.6.12.

I'm thinking of sticking to coverage==7.6.12 for now, and revisiting the situation once we upgrade to Python 3.13 and later 3.14 if needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants