/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 bzrlib/versionedfile.py

  • Committer: John Arbash Meinel
  • Date: 2010-08-04 07:14:54 UTC
  • mto: This revision was merged to the branch mainline in revision 5390.
  • Revision ID: john@arbash-meinel.com-20100804071454-bfhbwrqes7sabvay
Populate the offsets array.

This cuts down the number of bisections dramatically, basically by pre-caching
the first step. On real-world data it drops the steps from 587 to 156.
Or from 4.9/key to 1.3/key.
This drops the time to lookup from 23.7us to 20.3us.
Note that (k in dict) is 12.2us. I do wish we were just a bit closer to that.
However, with _LeafNode inherited from dict, I get 26us, so
maybe there is something in the interpreter that does a PyDict_CheckExact
call, and there isn't much we can do about it.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1085
1085
                parent_lines, left_parent_blocks))
1086
1086
        return diffs
1087
1087
 
 
1088
    def get_annotator(self):
 
1089
        return annotate.Annotator(self)
 
1090
 
1088
1091
    missing_keys = index._missing_keys_from_parent_map
1089
1092
 
1090
1093
    def _extract_blocks(self, version_id, source, target):
1159
1162
            result.append((prefix + (origin,), line))
1160
1163
        return result
1161
1164
 
1162
 
    def get_annotator(self):
1163
 
        return annotate.Annotator(self)
1164
 
 
1165
1165
    def check(self, progress_bar=None, keys=None):
1166
1166
        """See VersionedFiles.check()."""
1167
1167
        # XXX: This is over-enthusiastic but as we only thunk for Weaves today