diff options
author | Chris Larson <chris_larson@mentor.com> | 2010-09-23 11:21:29 -0700 |
---|---|---|
committer | Richard Purdie <rpurdie@linux.intel.com> | 2011-01-04 14:46:36 +0000 |
commit | 3f40a2efe835ba6c6660485f11d0460332d401d1 (patch) | |
tree | 1e441dca05746e158aef538695ec4a083fd4bef9 /bitbake/lib | |
parent | 666513982fb767c992471a4dce2aa2f7b9c9cdfb (diff) | |
download | poky-3f40a2efe835ba6c6660485f11d0460332d401d1.tar.gz |
Reduce bb.cache memory usage a bit
- Don't store key/value pairs when the value is None
- Delete the depends_cache when we're done with it
This reduces the memory usage after sync on initial parse by roughly 11.5% on
this machine.
(Bitbake rev: c7eb4c989459d182fdf9c81a627d32b7ef11626b)
Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
Diffstat (limited to 'bitbake/lib')
-rw-r--r-- | bitbake/lib/bb/cache.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/bitbake/lib/bb/cache.py b/bitbake/lib/bb/cache.py index 255c6168dd..7ec55bc1be 100644 --- a/bitbake/lib/bb/cache.py +++ b/bitbake/lib/bb/cache.py | |||
@@ -118,7 +118,8 @@ class Cache: | |||
118 | 118 | ||
119 | self.cacheclean = False | 119 | self.cacheclean = False |
120 | result = bb.data.getVar(var, self.data, exp) | 120 | result = bb.data.getVar(var, self.data, exp) |
121 | self.depends_cache[fn][var] = result | 121 | if result is not None: |
122 | self.depends_cache[fn][var] = result | ||
122 | return result | 123 | return result |
123 | 124 | ||
124 | def setData(self, virtualfn, fn, data): | 125 | def setData(self, virtualfn, fn, data): |
@@ -219,7 +220,6 @@ class Cache: | |||
219 | virtuals += 1 | 220 | virtuals += 1 |
220 | return False, skipped, virtuals | 221 | return False, skipped, virtuals |
221 | 222 | ||
222 | |||
223 | def cacheValid(self, fn): | 223 | def cacheValid(self, fn): |
224 | """ | 224 | """ |
225 | Is the cache valid for fn? | 225 | Is the cache valid for fn? |
@@ -346,6 +346,7 @@ class Cache: | |||
346 | 346 | ||
347 | p = pickle.Pickler(file(self.cachefile, "wb" ), -1 ) | 347 | p = pickle.Pickler(file(self.cachefile, "wb" ), -1 ) |
348 | p.dump([cache_data, version_data]) | 348 | p.dump([cache_data, version_data]) |
349 | del self.depends_cache | ||
349 | 350 | ||
350 | def mtime(self, cachefile): | 351 | def mtime(self, cachefile): |
351 | return bb.parse.cached_mtime_noerror(cachefile) | 352 | return bb.parse.cached_mtime_noerror(cachefile) |