QOTW?

Peter Hansen peter at engcorp.com
Mon Jan 12 15:13:54 CET 2004


Ganesan R wrote:
> 
> >>>>> "Samuel" == Samuel Walters <swalters_usenet at yahoo.com> writes:
> 
> > I/O is one of our strengths, because we understand that most programs are
> > not algorithmically bound, but rather I/O bound.  I/O is a big
> > bottle-neck, so we should be damn good at it.  The fastest assembly
> > program won't do much good if it's always waiting on the disk-drive.
> 
> Actually, Python is much slower than Perl for I/O. See the thread titled
> "Python IO Performance?" in groups.google.com for a thread started by me on
> this topic. I am a full time C programmer but do write occasional
> Python/Perl for professional/personal use.
> 
> To answer the original question about how much percentage of time I spend
> optimizing my Python programs - probably never. However I did switch back to
> using Perl for my most of my text processing needs. For one program that was
> intended to lookup patterns in a gzipped word list, performance of the
> original python version was horribly slow. Instead of rewriting it in Perl,
> I simply opened a pipe to zgrep and did post processing in python. This
> turned out to be much faster - I don't remember how much faster, but I
> remember waiting for the output from the pure python version while the
> python+zgrep hybrid results were almost instantaneous.

I didn't consider this sort of thing in my poll, but I'd have to say you 
actually *are* optimizing your Python programs, even if you did it by falling 
back on another language...

-Peter



More information about the Python-list mailing list