Profiling 'bzr annotate'

John Arbash Meinel john at arbash-meinel.com
Thu Jan 24 23:05:18 GMT 2008


I'm trying to work on making 'bzr annotate' faster in the general case. 
One thing that we discussed was adding cached annotations.

As a test case I used "bzrlib/repository.py". Under lsprof, doing:
   bzr annotate bzrlib/repository.py
takes 40s.

It turns out a significant amount of that time (13.1s) is because of 
get_revision_id_to_reno_map. Because it is using get_revision_graph, 
which as we know is slower with packs. There are other parts that are 
slow, though, because doing:
   bzr annotate --long --show-ids

drops the time to 23s (17s faster).

"reannotate" is the next big culprit, with the other 14s. It is hard to 
tell how many times it is called, though, because it is an iterator, so 
it claims to be called 1.5 million times (with the _reannotate helper 
being called 2.1M times).

Switching it to using lists instead of yield dropped the time from 13.7s 
to 11.3s and showed 704 calls. I just sent a patch for that.

I think we should come up with an answer for get_revision_graph(), and 
how it would interact with mapping revision ids => revision numbers.

John
=:->



More information about the bazaar mailing list