python vs awk for simple sysamin tasks

William Park opengeometry at yahoo.ca
Sat Jun 5 01:17:12 CEST 2004


Steve Lamb <grey at despair.dmiyu.org> wrote:
> >>     It is amazing how much shell bogs down when you're running it
> >>     over several hundred thousand directories.  :P
> 
> > Same would be true for Python here.
> 
>     Not as much as shell.  With shell you have thousands upon
>     thousands of fork/execs getting in the way.  In the case I am
>     thinking of rewriting the shell script into Perl and doing all the
>     logic processing internally cut the run time down from 7-8 hours
>     down to *2*.  I have seen similar perfomance numbers from Python
>     when compared to shell though not on that scale.  I mean the same
>     could be said for C, or Assembly.  Yes, iterations over large sets
>     of data is going to increase runtimes.  However there are
>     inefficiencies not present in a scripting language which are
>     present in shell which make it exceptionally longer to run.

4x faster?  Not very impressive.  I suspect that it's poor quality shell
script to begin with.  Would you post this script, so that others can
correct your misguided perception?

-- 
William Park, Open Geometry Consulting, <opengeometry at yahoo.ca>
No, I will not fix your computer!  I'll reformat your harddisk, though.



More information about the Python-list mailing list