Speed of Python vs. Perl

bowman bowman at montana.com
Thu Jan 11 10:00:43 EST 2001


Tim Hammerquist <tim at degree.ath.cx> wrote
>
> I'm glad you mentioned this.  If speed is _that_ important for any given
> program, consider if it should be written in a lower-level language such
> as C/C++, or just cut out the processor intensive section, write and
> compile in C, and link in.  Both Perl and Python support this.

Watch the C/C++ part :). In _The Practice of Programming_ by Kernighan and
Pike, a Markov chain implementation is examined using C, C++, Java, Perl
and Awk.

On WinNT, Perl completely hoses C++; on a R10000, Perl is faster than C++
using deque, and almost equal to C++ with a STL list implementation.

Unfortunately, Python wasn't included; however many very good points are
made wrt the ease of implementing the algo in each language, the vagaries of
libraries (STL on NT), and so on.

I'd recommend the book for anyone interested in a very down to earth
discussion
of efficiencies, design, choice of languages and other real world issues.






More information about the Python-list mailing list