Is python very slow compared to C

Michael Tobis mtobis at gmail.com
Sat Feb 11 19:56:54 EST 2006


Experienced programmers learning Python should read this:

http://effbot.org/zone/python-objects.htm

Try to understand the advantages of this approach, and understand its
costs.

Essentially, everything you do in Python (or related languages)
involves resolving a name. Sometimes the number of dictionary look-ups
(name dereferences) required to do anything is very expensive in
runtime performance.

If your code is not compute-bound (as most codes are not; these days
communication-bound or limited by database performance are more common)
the increase in your own performance will be much more important. If
your code does do so much computing (as mine do) that performance
matters, you may still find Python useful, but it is less of a
slam-dunk.

mt




More information about the Python-list mailing list