diff options
author | Lars Wirzenius <liw@liw.fi> | 2017-02-12 17:29:27 +0200 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2017-02-12 17:29:27 +0200 |
commit | 7ab0ddedc704bcdd21037d255faa2b4d1f9a313a (patch) | |
tree | e15b66cffcfe7f91f48476ce56ce78f99f55d9ac | |
parent | 70deda41d302c45e394fde03d4db02f6bb877e38 (diff) | |
download | obnam-7ab0ddedc704bcdd21037d255faa2b4d1f9a313a.tar.gz |
Attempt to comput chunk ids in a geneartion more efficiently
-rw-r--r-- | obnamlib/fmt_ga/client.py | 13 |
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): |