* [gentoo-portage-dev] [PATCH] portdbapi.aux_get: don't cache in memory unless frozen
@ 2016-03-05 7:14 Zac Medico
2016-03-06 15:11 ` Brian Dolbec
0 siblings, 1 reply; 2+ messages in thread
From: Zac Medico @ 2016-03-05 7:14 UTC (permalink / raw
To: gentoo-portage-dev; +Cc: Zac Medico
Fix the portdbapi aux_get method to cache metadata in memory only when
the "frozen" flag has been set, so that applications do not consume more
memory than necessary. This change does not affect depgraph performance,
since depgraph caches the metadata separately (in Package instances).
X-Gentoo-Bug: 576488
X-Gentoo-Bug-url: https://bugs.gentoo.org/show_bug.cgi?id=576488
---
pym/portage/dbapi/porttree.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/pym/portage/dbapi/porttree.py b/pym/portage/dbapi/porttree.py
index 23f3169..1f4374e 100644
--- a/pym/portage/dbapi/porttree.py
+++ b/pym/portage/dbapi/porttree.py
@@ -550,7 +550,7 @@ class portdbapi(dbapi):
#finally, we look at our internal cache entry and return the requested data.
returnme = [mydata.get(x, "") for x in mylist]
- if cache_me:
+ if cache_me and self.frozen:
aux_cache = {}
for x in self._aux_cache_keys:
aux_cache[x] = mydata.get(x, "")
@@ -817,6 +817,7 @@ class portdbapi(dbapi):
def melt(self):
self.xcache = {}
+ self._aux_cache = {}
self.frozen = 0
def xmatch(self,level,origdep,mydep=None,mykey=None,mylist=None):
--
2.4.10
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [gentoo-portage-dev] [PATCH] portdbapi.aux_get: don't cache in memory unless frozen
2016-03-05 7:14 [gentoo-portage-dev] [PATCH] portdbapi.aux_get: don't cache in memory unless frozen Zac Medico
@ 2016-03-06 15:11 ` Brian Dolbec
0 siblings, 0 replies; 2+ messages in thread
From: Brian Dolbec @ 2016-03-06 15:11 UTC (permalink / raw
To: gentoo-portage-dev
On Fri, 4 Mar 2016 23:14:59 -0800
Zac Medico <zmedico@gentoo.org> wrote:
> Fix the portdbapi aux_get method to cache metadata in memory only when
> the "frozen" flag has been set, so that applications do not consume
> more memory than necessary. This change does not affect depgraph
> performance, since depgraph caches the metadata separately (in
> Package instances).
>
> X-Gentoo-Bug: 576488
> X-Gentoo-Bug-url: https://bugs.gentoo.org/show_bug.cgi?id=576488
> ---
> pym/portage/dbapi/porttree.py | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/pym/portage/dbapi/porttree.py
> b/pym/portage/dbapi/porttree.py index 23f3169..1f4374e 100644
> --- a/pym/portage/dbapi/porttree.py
> +++ b/pym/portage/dbapi/porttree.py
> @@ -550,7 +550,7 @@ class portdbapi(dbapi):
> #finally, we look at our internal cache entry and
> return the requested data. returnme = [mydata.get(x, "") for x in
> mylist]
> - if cache_me:
> + if cache_me and self.frozen:
> aux_cache = {}
> for x in self._aux_cache_keys:
> aux_cache[x] = mydata.get(x, "")
> @@ -817,6 +817,7 @@ class portdbapi(dbapi):
>
> def melt(self):
> self.xcache = {}
> + self._aux_cache = {}
> self.frozen = 0
>
> def
> xmatch(self,level,origdep,mydep=None,mykey=None,mylist=None):
I reviewed & approved on the bug. merged into master.
--
Brian Dolbec <dolsen>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-03-06 15:12 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-05 7:14 [gentoo-portage-dev] [PATCH] portdbapi.aux_get: don't cache in memory unless frozen Zac Medico
2016-03-06 15:11 ` Brian Dolbec
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox