diff options
author | Lars Wirzenius <liw@liw.fi> | 2015-12-31 23:46:42 +0200 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2015-12-31 23:46:42 +0200 |
commit | 43f1f878cab76a255db975600f6a41a1c6d683d8 (patch) | |
tree | fc80a126c0347a39abb11b6bf3adb51df58c05b9 /manual/en | |
parent | ca0e282cbf168ea7c2f895a8b7206a0f83ab052e (diff) | |
download | obnam-43f1f878cab76a255db975600f6a41a1c6d683d8.tar.gz |
Add a section on running Obnam under a profiler
Diffstat (limited to 'manual/en')
-rw-r--r-- | manual/en/160-tuning.mdwn | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/manual/en/160-tuning.mdwn b/manual/en/160-tuning.mdwn index 180a3389..160caab7 100644 --- a/manual/en/160-tuning.mdwn +++ b/manual/en/160-tuning.mdwn @@ -6,3 +6,42 @@ memory consumption, as well as ways to experiment to find a good set of values. See <http://obnam.org/faq/tuning/> for a start. + + +## Running Obnam under the Python profiler + +A **profiler** is a program that measures where another program spends +its time. This can be very useful for finding out why the other +program is slow. + +Obnam can easily be run under the Python profiler. You need to have +the profiler installed. Check with your operating system or Python +installation how to achieve that. To see if you have it installed, run +the following command on the command line: + + python -c 'import cProfile' + +If this outputs nothing, all is well. If it outputs an error such as +the following, you have not got the profiler installed: + + Traceback (most recent call last): + File "<string>", line 1, in <module> + ImportError: No module named cProfiler + +Once you have the profiler installed, run Obnam like this: + + OBNAM_PROFILE=backup.prof obnam bsckup + +This will cause the profiling data to be written to the file +`backup.prof`. You can do this for any Obnam command, and write it to +any file. + +The profiling data is in binary form. Obnam comes with a little helper +program to transform it to a human-readable form: + + obnam-viewprof backup.prof | less + +If you run the above command, you'll see that the humans to whom this +is readable are programmers and circus clowns. If you can understand +the output, great! If not, it's still useful to send that to the Obnam +developers to report a performance problem. |