The hypothesis library recently added coverage-led fuzzing, in which it needs to run a very short test many times, while examining the coverage between each trial. This (currently) involves many calls to
coverage.Collector.save_data, which in turn causes many calls to
realpath (and thus
lstat). In the extreme case,
lstat() ends up taking about 40% of the run time.
Can you please help me design a remedy? Some alternatives that I can think of:
- add a cache to
- replace the call to
abs_filewith a call to
canonical_pathalready has a cache
- Delegate the filename-normalization responsibility from Collector to CoverageData, such that we can specialize CoverageData and fix this within our dependent library.