Skip to content

Commit b3b05bd

Browse files
committed
perf: the file mapping cache was off by mistake. #1527
1 parent d00f1dd commit b3b05bd

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

Diff for: CHANGES.rst

+6-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,12 @@ development at the same time, such as 4.5.x and 5.0.
2020
Unreleased
2121
----------
2222

23-
Nothing yet.
23+
- Performance: an internal cache of file names was accidentally disabled,
24+
resulting in sometimes drastic reductions in performance. This is now fixed,
25+
closing `issue 1527`_. Thanks to Ivan Ciuvalschii for the reproducible test
26+
case.
27+
28+
.. _issue 1527: https://github.com/nedbat/coveragepy/issues/1527
2429

2530

2631
.. _changes_7-0-3:

Diff for: CONTRIBUTORS.txt

+1
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ Hugo van Kemenade
8181
Ilia Meerovich
8282
Imri Goldberg
8383
Ionel Cristian Mărieș
84+
Ivan Ciuvalschii
8485
J. M. F. Tsang
8586
JT Olds
8687
Jerin Peter George

Diff for: coverage/collector.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,7 @@ def disable_plugin(self, disposition: TFileDisposition) -> None:
433433
plugin._coverage_enabled = False
434434
disposition.trace = False
435435

436-
@functools.lru_cache(maxsize=0)
436+
@functools.lru_cache(maxsize=None) # pylint: disable=method-cache-max-size-none
437437
def cached_mapped_file(self, filename: str) -> str:
438438
"""A locally cached version of file names mapped through file_mapper."""
439439
return self.file_mapper(filename)

0 commit comments

Comments
 (0)