/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to doc/developers/profiling.txt

  • Committer: Vincent Ladeuil
  • Date: 2007-07-03 09:28:59 UTC
  • mto: (2584.1.1 Aaron's integration)
  • mto: This revision was merged to the branch mainline in revision 2585.
  • Revision ID: v.ladeuil+lp@free.fr-20070703092859-yl7j53209tfmhf7u
Take Martin and Robert comments into account.

* bzrlib/strace.py:
(strace): is now a wrapper that calls strace_detailed.
(strace_detailed): like strace before but with an option to
disable following forked children without polluting the kwargs
param.

* bzrlib/tests/test_strace.py:
(TestStrace.test_strace_callable_is_called,
TestStrace.test_strace_callable_result,
TestStrace.test_strace_result_has_raw_log): use strace_detailed
while disabling following forked children, the syntax is a bit
uglier but non-test users should never use anyway..

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
Profiling
 
2
=========
 
3
 
 
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
 
6
shown below::
 
7
 
 
8
  bzr --lsprof ...
 
9
 
 
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:
 
15
 
 
16
* if the filename ends in ".txt", it will be dumped in a text format.
 
17
 
 
18
* if the filename ends in ".callgrind", it will be converted to a format
 
19
  loadable by the KCacheGrind visualization tool.
 
20
 
 
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::
 
23
 
 
24
  bzr --lsprof-file status001.callgrind status
 
25
  kcachegrind status001.callgrind &
 
26
 
 
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.
 
31
 
 
32
Note that to use --lsprof you must install the lsprof module, which you
 
33
can get with::
 
34
 
 
35
  svn co http://codespeak.net/svn/user/arigo/hack/misc/lsprof