mirror of
https://github.com/pypa/pip
synced 2023-12-13 21:30:23 +01:00
Cache find_best_candidate results
This is possible because self.make_candidate_evaluator only depends
on:
- the function arguments which are keys to the cache
- self._target_python which never changes during a pip resolution
- self._candidate_prefs which never changes during a pip resolution
On a fresh install, pip install <a package with ~ 100 dependencies>
runs on my machine in:
master (a0e34e9cf7
)
=======================
0m33.058s
0m34.105s
0m32.426s
This commit
===========
0m15.860s
0m16.254s
0m15.910s
pip 20.2.4 - legacy resolver
============================
0m15.145s
0m15.040s
0m15.152s
This commit is contained in:
parent
4dc48da9db
commit
5ec275fca2
1 changed files with 1 additions and 0 deletions
|
@ -863,6 +863,7 @@ class PackageFinder(object):
|
||||||
hashes=hashes,
|
hashes=hashes,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@lru_cache(maxsize=None)
|
||||||
def find_best_candidate(
|
def find_best_candidate(
|
||||||
self,
|
self,
|
||||||
project_name, # type: str
|
project_name, # type: str
|
||||||
|
|
Loading…
Reference in a new issue