how fast is Python?

Cameron Laird claird at lairds.com
Sun Aug 24 11:09:28 EDT 2003


In article <3F44DFEB.60AB6492 at engcorp.com>,
Peter Hansen  <peter at engcorp.com> wrote:
>dan wrote:
>> 
>> However, there are definitely cases where a lot of code would need to
>> be optimized, and so I ask the question:  How fast is Python, compared
>> to say a typical optimizing C/C++ compiler?
>
>C is roughly 10 to 100 times faster than Python, though of course it's
>easy to find cases outside of this range, on either side.
>
>I use 30 as a general overall rule of thumb, in the exceptionally
>few cases where it seems relevant how much faster C would be.
>
>And in those very few cases, so far, I have consistently concluded
>I'm happy enough with the speed of Python given that the speed of
>*development* in Python is easily 5 to 10 times faster than the
>speed of development in C.  (And again, it's easy to find cases 
>outside of this range, on either side...)
			.
			.
			.
I just think Peter's wise counsel bears repeating.

Andrew gave the same quantities, incidentally.  Myself, 
I use ten "as a general over-all rule of thumb", and
expect generally to be in the three-to-thirty range.  I
know other programmers whose Python work consistently
runs about one-one-hundredth as fast as the C equivalent.
As near as I can tell, that reflects on the kinds of
programming we do (how numeric, and so on), rather than
the quality of our coding.
-- 

Cameron Laird <Cameron at Lairds.com>
Business:  http://www.Phaseit.net
Personal:  http://phaseit.net/claird/home.html




More information about the Python-list mailing list