From 3274cbad045d9ee2e67384564d772a019cad0c9e Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Sun, 11 Oct 2020 11:12:04 -0400 Subject: Fix --source performance regression. #1037 --- coverage/control.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'coverage/control.py') 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.") -- cgit v1.2.1