)
When using branch coverage on Python 3.14+, sysmon ends up being
slower than ctrace. This is because sysmon's big advantage is
disabling events after the first time a line is seen. But for
branch coverage it cannot do that, since the same line can be
reached from many different places in the code. So it keeps firing
a Python callback on every single execution, which is actually
slower than ctrace's C-level trace function.
Fix: when branch=True and the user has not explicitly chosen a
core, quietly fall back to ctrace instead. If you explicitly set
COVERAGE_CORE=sysmon you still get sysmon. This only affects the
default behavior.
Fixes #2172
When using branch coverage on Python 3.14+, sysmon ends up being slower than ctrace. This is because sysmon's big advantage is disabling events after the first time a line is seen. But for branch coverage it cannot do that, since the same line can be reached from many different places in the code. So it keeps firing a Python callback on every single execution, which is actually slower than ctrace's C-level trace function.
Fix: when branch=True and the user has not explicitly chosen a core, quietly fall back to ctrace instead. If you explicitly set COVERAGE_CORE=sysmon you still get sysmon. This only affects the default behavior.