Why is text file processing SO slow?

Erik Max Francis max at alcyone.com
Thu Sep 21 08:24:56 CEST 2000

jaimewyant at my-deja.com wrote:

> 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?

No.  You have not given us enough information to indicate how you're
processing the file.  Pseudocode can't tell you whether or not your
algorithms and idioms are well chosen.  Almost certainly the script can
be made much faster if you try; but without specifics about how you're
doing it it's hard to say.

 Erik Max Francis / max at alcyone.com / http://www.alcyone.com/max/
 __ San Jose, CA, US / 37 20 N 121 53 W / ICQ16063900 / &tSftDotIotE
/  \ Whoever contends with the great sheds his own blood.
\__/ Sa'di
    Maths reference / http://www.alcyone.com/max/reference/maths/
 A mathematics reference.

More information about the Python-list mailing list