There’s a comment in the code that “echo seems a little faster than find, even with -depth 3” but I don’t remember how much difference there really was. It would be interesting to see some numbers, if someone could put together a test.
I wonder if some sort of flag is in order, to control whether a depth search is performed or not. For example, setting VIRTUALENVWRAPPER_PROJECT_SEARCH_DEPTH to some value > 0 could trigger using find instead of echo, and then the find maxdepth argument could be computed based on the value given (it might need to be 2 more than the value given to account for the bin directory and activate script that we’re looking for).
All of that might be more complex than needed, too. We could just switch to using compgen -d more directly. It would result in false positives if there are directories under $WORKON_HOME that aren’t actually virtualenvs, but maybe that’s not such a big deal.
Thoughts?
Doug