Code review comment for lp:~spiv/bzr/smarter-index-search

Revision history for this message
John A Meinel (jameinel) wrote :

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Andrew Bennetts wrote:
> Andrew Bennetts has proposed merging lp:~spiv/bzr/smarter-index-search into lp:bzr.
>
> Requested reviews:
> John A Meinel (jameinel)
>
>
> Optimise index lookups in repositories with many pack files.
>
> First, the headline: this greatly improves "bzr pull" of one new revision of grub from savannah by HTTP (as reported on the mailing list, which has further analysis):

This doesn't seem to be as cheap as I expected it to be. I'm not 100%
sure who is at fault here, but I'm doing some profiling of loggerhead +
bzr-history-db, and I came across this:

       25765 3.4509 1.8229 bzrlib.index:1425(_move_to_front_by_index)
     +489715 0.8904 0.8904 +bzrlib.btree_index:689(__eq__)
     +541075 0.6721 0.6721 +<method 'append' of 'list' objects>
      +25765 0.0654 0.0654 +<zip>
      489809 0.8906 0.8906 bzrlib.btree_index:689(__eq__)
      590334 0.7374 0.7374 <method 'append' of 'list' objects>
         153 0.2031 0.2031 <method 'write' of 'file' objects>
       20612 3.0278 0.1986 bzrlib.index:1451(_move_to_front_by_name)
      +20612 2.7483 1.4505 +bzrlib.index:1425(_move_to_front_by_index)

I'm guessing the issue is something walking over the ancestry (like bzr log)

5153 3.8017 0.0712 bzrlib.index:1410(_move_to_front)

Note that only 5k calls to _move_to_front gets increased to 25k calls to
_move_to_front_by_index. (probably because there are
rix/iix/tix/cix/six, so a 5:1 factor).

However, we must be missing something for move to be that expensive.

I'm guessing this is:
https://bugs.launchpad.net/bugs/562429

John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkvFOf4ACgkQJdeBCYSNAAN1DACggkq3WmxiFrLuE6Nqi/a7Jr+7
k6gAniipAYSMpW98NK22pdksK588g+1a
=RE1+
-----END PGP SIGNATURE-----

« Back to merge proposal