ideas for C optimization wanted

Martin Pool mbp at canonical.com
Thu Jul 3 05:07:48 BST 2008


Tim said to me he was interested in doing some C or Pyrex code to
speed up Bazaar, and asked for suggestions on where to begin.

One that comes to mind for me would be changing some of the larger
performance-critical functions in workingtree_4.py (like
InterDirStateTree.iter_changes) to have a simple Python implementation
and a fast C implementation.  Some of them are pretty long, partly
because of wanting to avoid python function-call overhead.   But it
would be a good idea to do some profiling with lsprof first and see if
they are actually near the top in current code.  You should make sure
lsprof is installed and working before going offline.

There are some notes here
<http://doc.bazaar-vcs.org/bzr.dev/developers/profiling.html> on how
to profile Bazaar and in
<http://doc.bazaar-vcs.org/bzr.dev/en/developer-guide/HACKING.html> on
development generally, including writing C extensions.

Another thing that would be good but might be beyond the time
available would be to bind in xdelta or another binary format into a
new repository format.

-- 
Martin <http://launchpad.net/~mbp/>



More information about the bazaar mailing list