Python does not stand a chance if you pitch it against C/C++, but as long as you stick to the same kind of languages (i e interpreted, dynamically typed), Python is probably one of the fastest languages around.
For example, does it almost consistently perform better than Perl, TCL and Ruby in all the algorithmic tests in the Computer Language Shootout (http://dada.perl.it/shootout/) and if you pair it together with Psyco you get very close to the speed of a compiled language.
You are right when you say that the performance is not Python's main selling point, but the execution speed is more than often for sufficent for most applications, and for the rest you have a number of options:
* Use Psyco
* Use Pyrex to translate part of you Python code to C
* Write an extension module in C/C++ (e g with the help of SWIG, BOOST)
* Wait for PyPy to be ready... :)
Comment
"The Great Win32 Computer Language Shootout" has not been updated in the last 2 years.
"The Computer Language Shootout" is active, see
http://shootout.alioth.debian.org/benchmark.php?test=all&lang=python&sort=fullcpu
To contribute programs see the FAQ
http://shootout.alioth.debian.org/faq.php?sort=fullcpu#contribute
Parent comment
Python does not stand a chance if you pitch it against C/C++, but as long as you stick to the same kind of languages (i e interpreted, dynamically typed), Python is probably one of the fastest languages around. For example, does it almost consistently perform better than Perl, TCL and Ruby in all the algorithmic tests in the Computer Language Shootout (http://dada.perl.it/shootout/) and if you pair it together with Psyco you get very close to the speed of a compiled language. You are right when you say that the performance is not Python's main selling point, but the execution speed is more than often for sufficent for most applications, and for the rest you have a number of options: * Use Psyco * Use Pyrex to translate part of you Python code to C * Write an extension module in C/C++ (e g with the help of SWIG, BOOST) * Wait for PyPy to be ready... :)
Replies
So, python occasionally uses more memory but clearly much faster than ruby. Thanks for the link Isaac.