After extensive development, coverage.py can effectively utilize Python's sys.monitoring to enhance its branch coverage measurement capabilities. This new implementation promises notable performance improvements over the traditional method, which relied on sys.settrace and resulted in overhead due to redundant calls. The journey involved substantial collaboration and discussion, particularly with Mark Shannon, to pinpoint desired behaviors for more efficient coverage. Users can activate this new feature by setting an environment variable, indicating that with the right setup, coverage should run faster and more efficiently than before.
After nearly two years, coverage.py can now utilize sys.monitoring for more efficient branch coverage measurement, allowing for faster performance.
By setting COVERAGE_CORE=sysmon and running coverage, users should experience improved efficiency, thanks to the reduction in unnecessary function calls.
The development journey involved extensive discussions with Mark Shannon regarding the behavior of sys.monitoring, ultimately leading to a successful implementation.
The traditional method of using sys.settrace was effective but inefficient; sys.monitoring allows for disabling events after the first trigger, enhancing performance.
Collection
[
|
...
]