Python speed and `pcre'

Hrvoje Niksic hniksic at srce.hr
Fri Sep 3 03:23:06 EDT 1999


François Pinard <pinard at iro.umontreal.ca> writes:

> Hrvoje Niksic <hniksic at srce.hr> écrit:
> 
> > > After having translated some code (not big, but not small) from Perl
> > > to Python, I discover it runs ten times slower.
> 
> Hello, Hrvoje.  You are interested in Python, too?

But of course.  :-)

> > This is my usual result when comparing just about any code where
> > speed actually matters (for me it's usually processing of large
> > textual files.)
> 
> Are you serious?  Scheme is based, like Python, on dynamic typing,
> and from my experience, is acceptably fast processing large files.
> And a compiler is available to get more speed, which produces code
> that might start to compete with C when, the proper pragmas are
> added.

All of this may be true for Scheme, but it's not my experience with
Python.  Python is very nice and clear, but also very very slow.  If
you are into text-crunching, try writing equivalent Perl and Python
programs and unleash them on a large file.

> Of even worse, using a cluttered Python style as an attempt to
> recover a small part of the lost speed.  I'm ready to reasonably
> trade speed for clarity, but I would not like ending loosing both!

Python gives more in clarity than it takes away in speed.  Especially
when compared to Perl.  :-)




More information about the Python-list mailing list