Why is text file processing SO slow?

Terry Reedy tjreedy at udel.edu
Wed Sep 20 20:12:22 EDT 2000


<jaimewyant at my-deja.com> wrote in message
news:8qb5j8$g17$1 at nnrp1.deja.com...
...
> The above algorithm is only slightly stripped down.  The above program
> written in Python takes 55 seconds to execute.  The same program
> written in perl takes 15 seconds.  The C version takes 10 seconds.
>
> Is it typically a BAD idea to use Python (1.5.2) to process text files?

We need more data to answer.

1) How many minutes/hours did it take you to write and completely debug
each of the versions?  More important, what is you estimate of how long it
would have taken for each if that one had been writen first?
2) How many times will you run the program?
3) What is your exchange rate between computer time and human time?  (By
traditional economic principles, a human hour is now worth at least 100 x a
pc hour.)
4) What adjustment should be made for the fact that programming time saved
is now and computer time spent extra is in the future?
5) Will anyone actually be sitting and twiddling their thumbs during the
extra 45 seconds?  6) If there will be such a person, will that person
consider the breather a cost or a benefit?

For some people, the answers to all these questions add up to NO, it is not
bad idea but a good idea or even a great idea.

Terry J. Reedy





More information about the Python-list mailing list