Why is text file processing SO slow?

gangli at msn.com gangli at msn.com
Thu Sep 21 10:09:52 EDT 2000


I wrote a Y2K hot spot detecting program for COBOL. The optimized
version is 12 times faster than the prototype.  The trick is to use
profile to detect where is the bottleneck, then optimize the hot spot.
If you post the real code, I can do the profile.


In article <39C9A9B8.8B79928E at alcyone.com>,
  Erik Max Francis <max at alcyone.com> wrote:
> 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.
>


Sent via Deja.com http://www.deja.com/
Before you buy.



More information about the Python-list mailing list