1 |
Add lru_cache to speed up the running time of "Calculating |
2 |
dependencies". |
3 |
|
4 |
In a ChromeOS use case, this patch decreases the running time from |
5 |
311s to 197s with almost no memory usage increase. |
6 |
|
7 |
Signed-off-by: Pin-yen Lin <treapking@××××××××.org> |
8 |
--- |
9 |
lib/_emerge/depgraph.py | 1 + |
10 |
1 file changed, 1 insertion(+) |
11 |
|
12 |
diff --git a/lib/_emerge/depgraph.py b/lib/_emerge/depgraph.py |
13 |
index ce6cabcc1..9649bb2a8 100644 |
14 |
--- a/lib/_emerge/depgraph.py |
15 |
+++ b/lib/_emerge/depgraph.py |
16 |
@@ -2240,6 +2240,7 @@ class depgraph: |
17 |
|
18 |
return None |
19 |
|
20 |
+ @functools.lru_cache(maxsize=100) |
21 |
def _slot_operator_check_reverse_dependencies( |
22 |
self, existing_pkg, candidate_pkg, replacement_parent=None |
23 |
): |
24 |
-- |
25 |
2.38.1.584.g0f3c55d4c2-goog |