Skip to content

sysmon is slower than ctrace on 3.14 for the Scrapy test suite #2172

Open

Description

@wRAR

I hate to file yet another performance/cores/Python versions report but I haven't seen anything related, only the opposite ones. Out of the box Scrapy tests are much slower on 3.14 than on 3.13, and the 3.14 speed can be improved by setting COVERAGE_CORE=ctrace.

Some numbers:

  • On current master the GitHub CI runs for the Ubuntu py env for 3.13 and 3.14 report respectively 244.02s (0:04:04) and 460.74s (0:07:40), this is with 4 xdist workers.
  • Locally without xdist I get 291.91s (0:04:51) for 3.13, 394.46s (0:06:34) for 3.14 and 296.78s (0:04:56) for 3.14 with COVERAGE_CORE=ctrace.
  • Locally with xdist (16 workers) I get 46.57s for 3.13, 79.93s (0:01:19) for 3.14 and 47.94s for 3.14 with COVERAGE_CORE=ctrace.

The way to reproduce this is to clone https://github.com/scrapy/scrapy and run tox -e py with various settings and Python versions (note that COVERAGE_* aren't in passenv though).

The currently used versions are Python 3.13.12/3.13.13 and 3.14.5, coverage 7.14.0, pytest-cov 7.1.0, pytest 9.0.3. COVERAGE_DEBUG=core doesn't print anything. The config:

[tool.coverage.run]
branch = true
include = ["scrapy/*"]
omit = ["tests/*"]
disable_warnings = ["include-ignored"]
patch = [
    "subprocess",
]

[tool.coverage.paths]
source = [
    "scrapy",
    ".tox/**/site-packages/scrapy"
]

[tool.coverage.report]
exclude_also = [
    "@(abc\\.)?abstractmethod",
    '\A(?s:.*# pragma: no file cover.*)\Z',
]

Activity

  1. added
    bug
    on May 16, 2026
  2. Supull commented on May 21, 2026

    @Supull

    Hi @wRAR I opened PR #2175 which should fix this. Sysmon cannot disable events for already seen arcs in branch mode, so it ends up slower than ctrace. The fix makes coverage quietly fall back to ctrace when branch=True and no core is explicitly set. Would love if you could test it against the Scrapy suite since you have the real numbers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions