~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/btree_index.py

  • Committer: John Arbash Meinel
  • Date: 2008-08-21 19:53:53 UTC
  • mto: This revision was merged to the branch mainline in revision 3644.
  • Revision ID: john@arbash-meinel.com-20080821195353-1q7mrhcjqerr5rhh
Somewhat surprisingly, tracking bytes_out_len makes a
large difference in performance. It drops the three_level test time
from 9.2s => 8.2s. My best guess is that when adding with Z_SYNC_FLUSH
we get a *lot* of small strings, and we loop over it each time
we add another string.
Real world tests show improvement, too.
For mysql, repack=2,nocopy time 59.3=>57.4
For bzr.dev, repack=2,nocopy time 9.6=>9.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
372
372
            copied_len = osutils.pumpfile(row.spool, result)
373
373
            if copied_len != (row.nodes - 1) * _PAGE_SIZE:
374
374
                if type(row) != _LeafBuilderRow:
375
 
                    import pdb;pdb.set_trace()
376
375
                    raise AssertionError("Not enough data copied")
377
376
        result.flush()
378
377
        size = result.tell()