Why is Python so slow?

Jean-Claude Wippler jcw at equi4.com
Fri Jun 9 07:56:49 EDT 2000


On Fri, 9 Jun 2000, William Dandreta wrote:
> Why does it take Python 50 times longer than C?

Because Python is a high-level interpreted language.  As others have 
pointed out, the 50x figure you state is pessimistic.

Absolute speed is a confusing metric - fast enough is what matters.

Like every scripting language, Python lets you code at more than one 
level of abstraction:  take the slow part, recode in C/C++, and Python 
will always be fast enough.  Given that 80% of the time is spent in 20% 
of the code, just figure out what the 20% are, then rethink/recode.

Now compare the total time to complete the job:  all in C/C++ vs. all in 
Python and then (maybe) recode some of it.  The second wins hands down.  
Always - because there is (much) less code to write to do the job.

So one answer to your question is: who cares?

-- 
-jcw



More information about the Python-list mailing list