jfgailleur / fabricate

Automatically exported from code.google.com/p/fabricate
0 stars 0 forks source link

Speed up run()/shell() by not doing shell=True #15

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
At least in windows `subprocess.Popen('mycommand', shell=True)` is about 4
times as slow as without the shell, like `Popen('mycommand')`.

And our fabricate.shell() function always calls Popen with shell=True,
meaning it's a lot slower than it needs to be.

Bry and I discussed it, and we don't see any real problem with shell=False
being the default. If you really want bash/cmd.exe syntax, you can specify
`run('mycommand', shell=True)` manually. Or, if you want shell-style
globbing in Linux, you can use `glob.glob()` directly -- then your build
script would work the same in Windows as in Linux, too.

Any comments, Ber?

Original issue reported on code.google.com by benh...@gmail.com on 6 Aug 2009 at 4:15

GoogleCodeExporter commented 9 years ago
Oh, Bry thought we were mainly using shell=True so it looked in your PATH, but 
it
turns out subprocess looks in your path with shell=False too, so that's not a 
problem.

Original comment by benh...@gmail.com on 6 Aug 2009 at 4:16

GoogleCodeExporter commented 9 years ago
Fixed in r39.

Original comment by benh...@gmail.com on 11 Aug 2009 at 11:41