Adding caching and other optimizations to git.py's list_refs function.  This speeds up, e.g., "git ls" by a factor of 10-100 when there are numerous branches.