There may be better methods but I'd just instrument the code to spit
out timestamps at various points in its run. I'd use this method
because the git module invokes the git command line frequently so
chances are that one of the git command line calls is what's slow.
Putting some code to log the time around the calls to external git
will let you track down which call it is and also doesn't require you
to learn a lot of python to get started.
For doing this quick and dirty, I would use the python-q library which
does simplistic logging to $TMPDIR/q: https://pypi.python.org/pypi/q
With it you can put lines in your code like: