summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2017-02-12 17:29:27 +0200
committerLars Wirzenius <liw@liw.fi>2017-02-12 17:29:27 +0200
commit7ab0ddedc704bcdd21037d255faa2b4d1f9a313a (patch)
treee15b66cffcfe7f91f48476ce56ce78f99f55d9ac
parent70deda41d302c45e394fde03d4db02f6bb877e38 (diff)
downloadobnam-7ab0ddedc704bcdd21037d255faa2b4d1f9a313a.tar.gz
Attempt to comput chunk ids in a geneartion more efficiently
-rw-r--r--obnamlib/fmt_ga/client.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/obnamlib/fmt_ga/client.py b/obnamlib/fmt_ga/client.py
index f5fcfba9..635cc192 100644
--- a/obnamlib/fmt_ga/client.py
+++ b/obnamlib/fmt_ga/client.py
@@ -394,23 +394,24 @@ class GAClient(object):
def dump(msg):
return None
dump('before getting chunk ids used by genaration')
+
self._load_data()
dump('after loading data')
+
generation = self._lookup_generation_by_gen_number(gen_number)
dump('after looking up gen by gen_number')
+
metadata = generation.get_file_metadata()
dump('after getting file metadata for generation')
- sets = [
- set(metadata.get_file_chunk_ids(filename))
- for filename in metadata
- ]
- dump('after building list of sets of chunkids used by files')
- union = set().union(*sets)
+ union = set()
+ for filename in metadata:
+ union = union.union(set(metadata.get_file_chunk_ids(filename)))
dump('after building union of sets')
result = list(union)
dump('after constructing result')
+
return result
def get_file_children(self, gen_number, filename):