1 |
commit: 839ab46be1777e5886da28b98b53a462b992c5bf |
2 |
Author: Pin-yen Lin <treapking <AT> chromium <DOT> org> |
3 |
AuthorDate: Fri Nov 25 03:36:27 2022 +0000 |
4 |
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon Nov 28 00:37:41 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=839ab46b |
7 |
|
8 |
Add caching to _slot_operator_check_reverse_dependencies |
9 |
|
10 |
Add lru_cache to speed up the running time of "Calculating |
11 |
dependencies". |
12 |
|
13 |
In a ChromeOS use case, this patch decreases the running time from |
14 |
311s to 197s with almost no memory usage increase. |
15 |
|
16 |
Bug: https://bugs.gentoo.org/883071 |
17 |
Signed-off-by: Pin-yen Lin <treapking <AT> chromium.org> |
18 |
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org> |
19 |
|
20 |
lib/_emerge/depgraph.py | 1 + |
21 |
1 file changed, 1 insertion(+) |
22 |
|
23 |
diff --git a/lib/_emerge/depgraph.py b/lib/_emerge/depgraph.py |
24 |
index bb0824324..d0ea92ad9 100644 |
25 |
--- a/lib/_emerge/depgraph.py |
26 |
+++ b/lib/_emerge/depgraph.py |
27 |
@@ -2240,6 +2240,7 @@ class depgraph: |
28 |
|
29 |
return None |
30 |
|
31 |
+ @functools.lru_cache(maxsize=100) |
32 |
def _slot_operator_check_reverse_dependencies( |
33 |
self, existing_pkg, candidate_pkg, replacement_parent=None |
34 |
): |