~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/chk_map.py

Activate test for common node skipping. - 50 times performance improvement.

Show diffs side-by-side

added added

removed removed

Lines of Context:
190
190
                    return True
191
191
            return False
192
192
 
 
193
        loop_counter = 0
193
194
        while self_pending or basis_pending:
 
195
            loop_counter += 1
194
196
            if not self_pending:
195
197
                # self is exhausted: output remainder of basis
196
198
                for prefix, node, path in basis_pending:
266
268
                            yield (tuple(self_details[0].split('\x00')),
267
269
                                basis_details[1], self_details[1])
268
270
                        continue
269
 
                    # At least one side wasn't a string, we need to expand it
270
 
                    # before we can continue
 
271
                    # At least one side wasn't a string.
 
272
                    if (self._node_key(self_pending[0][1]) ==
 
273
                        self._node_key(basis_pending[0][1])):
 
274
                        # Identical pointers, skip (and don't bother adding to
 
275
                        # excluded, it won't turn up again.
 
276
                        heapq.heappop(self_pending)
 
277
                        heapq.heappop(basis_pending)
 
278
                        continue
 
279
                    # Now we need to expand this node before we can continue
271
280
                    if read_self:
272
281
                        prefix, node, path = heapq.heappop(self_pending)
273
282
                        if check_excluded(path):
278
287
                        if check_excluded(path):
279
288
                            continue
280
289
                        process_node(prefix, node, path, basis, basis_pending)
 
290
        # print loop_counter
281
291
 
282
292
    def iteritems(self, key_filter=None):
283
293
        """Iterate over the entire CHKMap's contents."""