Python Speed Question and Opinion

beliavsky at aol.com beliavsky at aol.com
Sun Jun 6 14:36:19 CEST 2004


michele.simionato at poste.it (Michele Simionato) wrote in message news:<95aa1afa.0406052016.1988132 at posting.google.com>...
> "Mark J. Nenadov" <mark at freelance-developer.com> wrote in message news:<pan.2004.06.05.03.40.00.900996 at freelance-developer.com>...
> > Generally speaking, you will find C and C++ to be the fastest languages.
> > Implementations of C/C++ are generally much faster than anything else
> 
> except Fortran. People keep forgetting about the oldest languages, but they
> are still the best for the purposes they were invented for.
> 

Thanks, Michele. I was debating whether to write the same thing :).
Although Fortran is the oldest language still in widespread use, it is
continuing to be updated, with Fortran 2003 supporting OOP and
interoperability with C, among other features.

A relatively recent speed comparison by Scott Robert Ladd at
http://www.coyotegulch.com/reviews/almabench.html of Fortran and C++
on Linux ia32, using the Intel Fortran and C++ compilers, found the
speeds to be very close. Gcc was often twice as slow.

If one has numerical code in Python using Numeric or Numarray, and one
needs to speed up the code, translating to Fortran 95 may be a good
alternative to C++. The multidimensional array of C is low-level and
is not comparable to the Numeric array. There are several templated
array classes in C++ with more functionality (allowing whole-array
operations, for example), but I do not know of any with general array
slices (corrections requested). Since Fortran 90, Fortran arrays have
had both array operations and slices.



More information about the Python-list mailing list