The --enable-pystats system has a couple of important shortcomings:
- When stats is turned off, stats aren't dumped (on quit or explicitly). Therefore, it's impossible to put
sys._stats_on/sys._stats_off calls around tested code and get the results out.
- Since stats collection is on by default, it is very fiddly to exclude code for stats, especially for things that fire off subprocesses, e.g. pyperformance.
@markshannon's suggestion is to:
- Having stats off by default
- Add an
-Xstats flag to turn it on at startup
- Always dump out stats
Linked PRs