Python is slow

Jeremiah Dodds jeremiah.dodds at gmail.com
Thu Dec 11 02:15:00 EST 2008


Does anybody else think it's really funny when people argue over which
language used for _web apps_ is fastest? I mean, I'm not aware of any
language that's slow enough to make it noticeable compared to say, network
latency or database access. I guess you might notice if you're not caching
any content, and your language of choice is _really_ bad at generating
strings in a for loop.

As far as "slow" goes, the clear winner(?) is Ruby, and there are _plenty_
of sites written in ruby that aren't slow. The ones that are slow aren't
slow because of ruby  - they're slow primarily because of people not knowing
how to write a database schema, as far as I can tell.

There seems to be a lot of stigma against python as being a "slow" language,
which I suppose it is when measured in certain ways - however it's more than
fast enough for me, and is certainly fast enough for web-apps (I run a few
sites on top of CherryPy, and have _never_ had an issue with them, even with
a minor redditing on one of them).

I had a freelance gig once porting an image-manipulation algorithm from C++
to python. It was a horrible mess of C++ code, but ran very fast (and did
exactly what my employer needed it to do). Porting it to python in a literal
led to (IIRC) a 10x speed-down. Changing that to more idiomatic python made
it only 3-5x slower than the C++. After translating that into, I think,
PyRex, it was barely slower than the original code. Certainly well within
the "acceptable" range.

When I did the above, I was really pretty new to python. If I did the same
job again, I'd probably get better results, just from understanding the
language better. But I digress.

The only places that I'm aware of where performance would be enough of an
issue to make Python a poor choice are places where using python would
_never_ be considered anyhow.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20081211/0e811d63/attachment-0001.html>


More information about the Python-list mailing list