improving python performance by extension module (64bit)

Stephen Hansen me+list/python at ixokai.io
Fri Jun 25 19:03:43 EDT 2010


On Fri, Jun 25, 2010 at 3:18 PM, Mark Lawrence <breamoreboy at yahoo.co.uk>wrote:

> On 25/06/2010 22:25, Stephen Hansen wrote:
>
>> On Fri, Jun 25, 2010 at 1:51 PM, Mark Lawrence<breamoreboy at yahoo.co.uk
>> >wrote:
>>
>>  On 25/06/2010 16:34, Stephen Hansen wrote:
>>>
>>>  Python's slow, sure. But its in practice fast enough for an extremely
>>>
>>>> broad
>>>> range of activities.
>>>>
>>> What?
>>
>> What, what?
>
> Python is *NOT* slow, you can develop software in it much faster than you
> can in some other languages.


Python is a very programmer-productive language, yes. It's still slow,
though. Me being able to develop fast in it doesn't make the language itself
fast or slow.


> The run time speed has also been shown to be faster in some circumstance
> than C because of the Bots who're smart enough to optimise it up to the
> hilt.
>

In some very, very narrow circumstances, -- very, very narrow -- sure, okay.
There's some cases where it might be faster.

However, that doesn't really change anything. Speed is not Python's strong
point: but it doesn't matter. Its fast enough, partly because it is indeed
very very productive and programmer time is an extremely  valuable resource.
And partly because its actually pretty easy to build extension modules for
it to optimize away bottlenecks.

The 90/10 rule means that it actually doesn't *matter* that it is slow:
since 90% of the program's time is spent in 10% of the code, if you write
that 90% in Python you'll save man-months or man-years of development, and a
drop in the bucket writing some more optimized extension to handle the 10%
will pay off hugely. Or you could just use one of many already wrapped
libraries that are very fast and efficient (like, numpy, or what not).

Embrace it, don't fight it. Or people will come in and go, "Python is slow!
You all suck!" and you'll be defensive, and enter into some big pointless
argument, and no one will change their mind, and hours and hours of
productive time will be wasted in the debate.

The proper response is to shrug, be indifferent, and say, "Its as fast as it
needs to be.(*)" :)

--S

P.S. *Which is not to say I wouldn't welcome the Unladen Swallow
improvements or anything. More speed is never /bad/, as long as its not at
the cost of our precious dynamic soul, but really-- it is fast enough.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20100625/349ad014/attachment-0001.html>


More information about the Python-list mailing list