/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to groupcompress.py

  • Committer: John Arbash Meinel
  • Date: 2009-02-27 03:04:49 UTC
  • mto: (0.20.21 trunk)
  • mto: This revision was merged to the branch mainline in revision 4280.
  • Revision ID: john@arbash-meinel.com-20090227030449-r8cmknorcmlgaqtm
Clustering chk pages properly makes a big difference.

By iterating root nodes in the same order as the referencing inventory,
and then iterating by search prefix, we get compression about 2:1 versus
not compressing at all, which is probably 50% better than random ordering.

Show diffs side-by-side

added added

removed removed

Lines of Context:
579
579
            valid until the iterator is advanced.
580
580
        """
581
581
        # keys might be a generator
582
 
        keys = set(keys)
 
582
        orig_keys = list(keys)
 
583
        keys = set(orig_keys)
583
584
        if not keys:
584
585
            return
585
 
        if not self._index.has_graph:
 
586
        if not self._index.has_graph and ordering == 'topological':
586
587
            # Cannot topological order when no graph has been stored.
587
588
            ordering = 'unordered'
588
589
        # Cheap: iterate
608
609
            #      balance that with the time it takes to extract ordering, by
609
610
            #      somehow grouping based on locations[key][0:3]
610
611
            present_keys = sort_gc_optimal(parent_map)
 
612
        elif ordering == 'as-requested':
 
613
            present_keys = [key for key in orig_keys if key in locations]
611
614
        else:
612
615
            # We want to yield the keys in a semi-optimal (read-wise) ordering.
613
616
            # Otherwise we thrash the _group_cache and destroy performance