tomerfiliba/plumbum — pull request #98 by jlisee (2013-11-13 03:40:05+00:00)
Title: Faster which/command lookup implementation

Taken from the twister.python.procutils.which this function speeds up the
importing of commands by a factor of 6, and which itself by a several
hundred times.

This is an example fix for issue #97.

On the master branch:
```
jlisee:$ time python -c "from plumbum.cmd import grep, wc, cat, head, ls, touch, mkdir, rm, echo, dd"

real 0m0.646s
user 0m0.588s
sys 0m0.048s
```

With this fix
```
jlisee:$ time python -c "from plumbum.cmd import grep, wc, cat, head, ls, touch, mkdir, rm, echo, dd"

real 0m0.061s
user 0m0.024s
sys 0m0.016s
```