/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/groupcompress.py

  • Committer: John Arbash Meinel
  • Date: 2009-03-27 04:05:28 UTC
  • mto: (3735.2.170 brisbane-core)
  • mto: This revision was merged to the branch mainline in revision 4280.
  • Revision ID: john@arbash-meinel.com-20090327040528-88uc1za4ep2fj6gh
Set 'combine_backing_indices=False' as the default for text and chk indices.
We may want them for something like commit according to Robert, though we have to
be committing more than 100k new texts for it to matter, and really more than
200k for it to trigger a combine. And it makes a very big difference
to 'fetch' performance.

Also, set random_id=True for 'insert_record_stream'. This makes another
big win for fetch performance, though we may need to decide if it is
genuinely safe.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1385
1385
        :return: None
1386
1386
        :seealso VersionedFiles.get_record_stream:
1387
1387
        """
1388
 
        for _ in self._insert_record_stream(stream):
 
1388
        for _ in self._insert_record_stream(stream, random_id=True):
1389
1389
            pass
1390
1390
 
1391
1391
    def _insert_record_stream(self, stream, random_id=False, nostore_sha=None,
1438
1438
        insert_manager = None
1439
1439
        block_start = None
1440
1440
        block_length = None
 
1441
        # XXX: TODO: remove this, it is just for safety checking for now
 
1442
        inserted_keys = set()
1441
1443
        for record in stream:
1442
1444
            # Raise an error when a record is missing.
1443
1445
            if record.storage_kind == 'absent':
1444
1446
                raise errors.RevisionNotPresent(record.key, self)
 
1447
            if random_id:
 
1448
                if record.key in inserted_keys:
 
1449
                    trace.note('Insert claimed random_id=True, but then inserted'
 
1450
                               ' %r two times', record.key)
 
1451
                    continue
 
1452
                inserted_keys.add(record.key)
1445
1453
            if reuse_blocks:
1446
1454
                # If the reuse_blocks flag is set, check to see if we can just
1447
1455
                # copy a groupcompress block as-is.