diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2020-10-11 11:12:04 -0400 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2020-10-11 11:12:04 -0400 |
commit | 3274cbad045d9ee2e67384564d772a019cad0c9e (patch) | |
tree | 350c4c9b6ca9595b2d5f162b31077832caa628cf /coverage/control.py | |
parent | ae35c27be0062721c82f1967e9eb7d6f041e5258 (diff) | |
download | python-coveragepy-git-3274cbad045d9ee2e67384564d772a019cad0c9e.tar.gz |
Fix --source performance regression. #1037
Diffstat (limited to 'coverage/control.py')
-rw-r--r-- | coverage/control.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/coverage/control.py b/coverage/control.py index 2d75417e..08649073 100644 --- a/coverage/control.py +++ b/coverage/control.py @@ -4,6 +4,7 @@ """Core control stuff for coverage.py.""" import atexit +import collections import contextlib import os import os.path @@ -737,9 +738,12 @@ class Coverage(object): # Touch all the files that could have executed, so that we can # mark completely unexecuted files as 0% covered. if self._data is not None: + file_paths = collections.defaultdict(list) for file_path, plugin_name in self._inorout.find_possibly_unexecuted_files(): file_path = self._file_mapper(file_path) - self._data.touch_file(file_path, plugin_name) + file_paths[plugin_name].append(file_path) + for plugin_name, paths in file_paths.items(): + self._data.touch_files(paths, plugin_name) if self.config.note: self._warn("The '[run] note' setting is no longer supported.") |