Python optimization (was Python's "only one way to do it" philosophy isn't good?)

Diez B. Roggisch deets at nospam.web.de
Tue Jun 12 08:46:16 EDT 2007


John Nagle wrote:

> Diez B. Roggisch wrote:
>> Regardless of the possibility of speeding it up - why should one want
>> this? Coding speed is more important than speed of coding in 90%+ of all
>> cases.
> 
>      When you have to start buying more servers for the server farm,
> it's a real pain.  I'm actually facing that because Python's HTML
> parsing is so slow.

I can't believe that this is a general "python is to slow"-issue. After all,
lxml and cElementTree are _really_ fast - and written in C.

For example in TurboGears, there are two python-only templating systems -
KID & genshi (apart from others). The latter is a magnitude faster than the
former. After all, O(n^3) is O(n^3), regardless of the language...

And if only the html-parsing is slow, you might consider creating an
extension for that. Using e.g. Pyrex.

Diez



More information about the Python-list mailing list