Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Command lookup is slow #97

Closed
jlisee opened this issue Nov 13, 2013 · 0 comments
Closed

Command lookup is slow #97

jlisee opened this issue Nov 13, 2013 · 0 comments

Comments

@jlisee
Copy link
Contributor

jlisee commented Nov 13, 2013

While looking to use plumbum to replace shell scripts at my organization everything was looking great until I noticed the slow execution speed. This simple one line command takes 650ms to execute on my machine:

time python -c "from plumbum.cmd import grep, wc, cat, head, ls, touch, mkdir, rm, echo, dd"

One of the biggest offenders appears to be slow "which" speed. You can see this in the results from this benchmark program I made:

# cmds: grep, wc, cat, head, ls, touch, mkdir, rm, echo, dd
from plumbum import local: 0.01800
twisted.python.procutils.which: 0.00042
plumbum local.which: 0.33167
from plumbum.cmd import: 0.62665

Here is the program: https://gist.github.com/jlisee/7443118

Platform details: Python 2.7.3, Ubuntu 12.04, 32 bit, Core i7 @ 2.4GHz

Any ideas how to fix this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants