How your company think about python?

Roy Smith roy at panix.com
Sun Aug 18 22:18:48 CEST 2002


d2002xx <d2002xx at myrealbox.com> wrote:
> Would you detail why they think that python can't develop real
> applications? (I know it's slow but...)

Yes, python is slow, but that doesn't have to mean that applications 
written in python have to be slow.

I won't name any names, but I'm currently involved with a commercial 
application written in C and C++, which has been shipping for several 
years.  Poor performance at a customer site led the development team to 
re-examine the code a while ago and it was discovered that the rate 
limiting step was a O(N^2) list insertion step.   The code was filled 
with all sorts of little efficiency hacks to bum a CPU cycle here or 
there, but the overall algorithm was quadratic, and for large inputs, 
that's all that mattered.

It's not hard to imagine that had the application been written in 
python, the list insertion step would have been done using dictionaries.  
I'm not sure how dictionaries work, but I'm guessing they're O(logN).  
Slower language (by pure benchmark numbers), but faster application.

Sure, the C code could have used a better insertion algorithm, but that 
would have meant writing a bunch of code (an investment in time which 
apparantly the original author didn't consider worthwhile).  Python 
gives you the better algorithm for free.  To be fair, if the code had 
been written today, it probably would have taken advantage of STL and 
gotten the same advantage.

The moral of the story is that it really doesn't make a lot of sense to 
talk about benchmark performance of languages in isolation of all the 
other things that go into the full life-cycle cost of an application.



More information about the Python-list mailing list