Return early if a directory isn't managed by git by cjwatson · Pull Request #10 · msabramo/setuptools-git (original) (raw)

This makes things much faster for large non-git trees that happen to
have setuptools_git among their indirect requirements. For example,
this takes Launchpad's "python setup.py egg_info" from 16 seconds to 2
seconds for me.

#6 would probably help as well, not to mention optimising the realpath handling so that it doesn't unnecessarily re-stat every path element for every file in your tree, which is a candidate for http://accidentallyquadratic.tumblr.com/ . But this is easy and non-intrusive.