1 |
On Fri, 4 Mar 2016 23:14:59 -0800 |
2 |
Zac Medico <zmedico@g.o> wrote: |
3 |
|
4 |
> Fix the portdbapi aux_get method to cache metadata in memory only when |
5 |
> the "frozen" flag has been set, so that applications do not consume |
6 |
> more memory than necessary. This change does not affect depgraph |
7 |
> performance, since depgraph caches the metadata separately (in |
8 |
> Package instances). |
9 |
> |
10 |
> X-Gentoo-Bug: 576488 |
11 |
> X-Gentoo-Bug-url: https://bugs.gentoo.org/show_bug.cgi?id=576488 |
12 |
> --- |
13 |
> pym/portage/dbapi/porttree.py | 3 ++- |
14 |
> 1 file changed, 2 insertions(+), 1 deletion(-) |
15 |
> |
16 |
> diff --git a/pym/portage/dbapi/porttree.py |
17 |
> b/pym/portage/dbapi/porttree.py index 23f3169..1f4374e 100644 |
18 |
> --- a/pym/portage/dbapi/porttree.py |
19 |
> +++ b/pym/portage/dbapi/porttree.py |
20 |
> @@ -550,7 +550,7 @@ class portdbapi(dbapi): |
21 |
> #finally, we look at our internal cache entry and |
22 |
> return the requested data. returnme = [mydata.get(x, "") for x in |
23 |
> mylist] |
24 |
> - if cache_me: |
25 |
> + if cache_me and self.frozen: |
26 |
> aux_cache = {} |
27 |
> for x in self._aux_cache_keys: |
28 |
> aux_cache[x] = mydata.get(x, "") |
29 |
> @@ -817,6 +817,7 @@ class portdbapi(dbapi): |
30 |
> |
31 |
> def melt(self): |
32 |
> self.xcache = {} |
33 |
> + self._aux_cache = {} |
34 |
> self.frozen = 0 |
35 |
> |
36 |
> def |
37 |
> xmatch(self,level,origdep,mydep=None,mykey=None,mylist=None): |
38 |
|
39 |
|
40 |
I reviewed & approved on the bug. merged into master. |
41 |
|
42 |
-- |
43 |
Brian Dolbec <dolsen> |