diff options
author | Ryan Shepherd <ryansh@microsoft.com> | 2023-03-23 14:26:17 -0700 |
---|---|---|
committer | Stéphane Bidoul <stephane.bidoul@gmail.com> | 2023-04-10 16:45:34 +0200 |
commit | 14736eac9c47d9ad30a79dfa60b1bc7dce4feb36 (patch) | |
tree | c01959f9b44cf9ba92f89aa0e86ca8be003f93c3 /src | |
parent | 6a8e403148be555cda5046932eadfed4dde2b035 (diff) | |
download | pip-14736eac9c47d9ad30a79dfa60b1bc7dce4feb36.tar.gz |
Document _normalize_path_cached
Diffstat (limited to 'src')
-rw-r--r-- | src/pip/_internal/req/req_uninstall.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/pip/_internal/req/req_uninstall.py b/src/pip/_internal/req/req_uninstall.py index 018e011d5..34d02ccaf 100644 --- a/src/pip/_internal/req/req_uninstall.py +++ b/src/pip/_internal/req/req_uninstall.py @@ -313,6 +313,9 @@ class UninstallPathSet: self._pth: Dict[str, UninstallPthEntries] = {} self._dist = dist self._moved_paths = StashedUninstallPathSet() + # Create local cache of normalize_path results. Creating an UninstallPathSet + # can result in hundreds/thousands of redundant calls to normalize_path with the same + # args, which hurts performance. self._normalize_path_cached = functools.lru_cache(maxsize=256)(normalize_path) def _permitted(self, path: str) -> bool: |