Bazaar has some built-in support for collecting and saving profiling
information. In the simpliest case, the
--lsprof option can be used as
brz --lsprof ...
This will dump the profiling information to stdout before exiting.
--lsprof-file option can be used to specify a filename
to save the profiling data into to. By default, profiling data saved to a
file is a pickled Python object making it possible to reload the data and
do with it what you will. For convenience though:
if the filename ends in
.txt, it will be dumped in a text format.
if the filename either starts with
callgrind.outor ends with
.callgrind, it will be converted to a format loadable by the KCacheGrind visualization tool.
Note that KCacheGrind’s Open Dialog has a default filter than only shows
files starting with
callgrind.out so the longer filename is usually
preferable. Here is an example of how to use the
in combination with KCacheGrind to visualize what the
brz --lsprof-file callgrind.out.st001 status kcachegrind callgrind.out.st001 &
brz also has a
--profile option that uses the hotshot profiler
instead of the lsprof profiler. The hotshot profiler can be useful
though the lsprof one is generally recommended. See
Note that to use
--lsprof you must install the lsprof module, which you
can get with:
svn co http://codespeak.net/svn/user/arigo/hack/misc/lsprof
Bazaar can log when locks are taken or released, which can help in
identifying unnecessary lock traffic. This is activated by the
This writes messages into
At present this only logs actions relating to the on-disk lockdir. It
doesn’t describe actions on in-memory lock counters, or OS locks (which
are used for dirstate.)
Profiling HPSS Requests¶
When trying to improve network performance, it is often useful to know
what requests are being made, and how long they are taking. The
global option will enable logging smart server requests, including the
time spent in each request.