Skip to content

Commit

Permalink
perf: the file mapping cache was off by mistake. #1527
Browse files Browse the repository at this point in the history
  • Loading branch information
nedbat committed Jan 7, 2023
1 parent d00f1dd commit ff3717a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
7 changes: 6 additions & 1 deletion CHANGES.rst
Expand Up @@ -20,7 +20,12 @@ development at the same time, such as 4.5.x and 5.0.
Unreleased
----------

Nothing yet.
- Performance: an internal cache of file names was accidentally disabled,
resulting in sometimes drastic reductions in performance. This is now fixed,
closing `issue 1527`_. Thanks to Ivan Ciuvalschii for the reproducible test
case.

.. _issue 1527: https://github.com/nedbat/coveragepy/issues/1527


.. _changes_7-0-3:
Expand Down
1 change: 1 addition & 0 deletions CONTRIBUTORS.txt
Expand Up @@ -81,6 +81,7 @@ Hugo van Kemenade
Ilia Meerovich
Imri Goldberg
Ionel Cristian Mărieș
Ivan Ciuvalschii
J. M. F. Tsang
JT Olds
Jerin Peter George
Expand Down
2 changes: 1 addition & 1 deletion coverage/collector.py
Expand Up @@ -433,7 +433,7 @@ def disable_plugin(self, disposition: TFileDisposition) -> None:
plugin._coverage_enabled = False
disposition.trace = False

@functools.lru_cache(maxsize=0)
@functools.lru_cache(maxsize=None)
def cached_mapped_file(self, filename: str) -> str:
"""A locally cached version of file names mapped through file_mapper."""
return self.file_mapper(filename)
Expand Down

0 comments on commit ff3717a

Please sign in to comment.