Use sys.monitoring
(PEP-669) for reduced overhead in the explain
phase on Python 3.12+
#3773
Labels
performance
go faster! use less memory!
As part of the
explain
phase, codenamed Scrutineer, we collect and analyze coverage information. This currently uses Python'ssys.settrace()
functionality, which provides hooks on which coverage analysis (or debuggers) can be implemented - at the cost of some performance overhead. From Python 3.12, PEP-669 offers a lower-overhead alternative in thesys.monitoring
module.Reimplementing the data-collection logic of Scrutineer using this new API offers us a basically free performance boost - so while the implementation might be tricky and it's not a huge priority while so few people have dropped older Python versions, I'm keen!
The text was updated successfully, but these errors were encountered: