4
Bazaar has some built-in support for collecting and saving profiling
5
information. In the simpliest case, the --lsprof option can be used as
10
This will dump the profiling information to stdout before exiting.
11
Alternatively, the --lsprof-file option can be used to specify a filename
12
to save the profiling data into to. By default, profiling data saved to a
13
file is a pickled Python object making it possible to reload the data and
14
do with it what you will. For convenience though:
16
* if the filename ends in ".txt", it will be dumped in a text format.
18
* if the filename ends in ".callgrind", it will be converted to a format
19
loadable by the KCacheGrind visualization tool.
21
Here is an example of how to use the --lsprof-file option in combination
22
with KCacheGrind to visualize what the "status" command is doing::
24
bzr --lsprof-file status001.callgrind status
25
kcachegrind status001.callgrind &
27
.. Note:: bzr also has a --profile option that uses the hotshot profiler
28
instead of the lsprof profiler. The hotshot profiler can be useful
29
though the lsprof one is generally recommended. See
30
http://docs.python.org/lib/node795.html.