Python is slow
jason.scheirer at gmail.com
Wed Dec 10 20:32:00 CET 2008
On Dec 10, 10:42 am, cm_gui <cmg... at gmail.com> wrote:
> I fully agree with Krzysztof Kowalczyk .
> Can't they build a faster VM for Python since they love the language
> so much?
> Python is SLOW. And I am not comparing it with compiled languages
> like C.
> Python is even slower than PHP!
> Just go to any Python website and you will know.
> An example is:http://www2.ljworld.com/
> And this site is created by the creators of Django!
> And it is not just this Python site that is slow. There are many many
> Python sites which are very slow. And please don’t say that it could
> be the web hosting or the server which is slow — because when so many
> Python sites are slower than PHP sites, it couldn’t be the web
> hosting. Also, Zope/Plone is even slower.
> Python is slow. Very slow.
I have two responses, and could not decide which one to post. Then I
figured I could just do both.
You have stumbled on to our plot! We use Python because we hate
getting things done and love nothing more than waiting for things to
complete, because that means more time to drink coffee. Python is a
hoax pushed on the world by the Vast Conspiracy Of People Who Actually
Never Get Anything Done But Enjoy Watching Things Scroll By Very
Slowly While Drinking Coffee.
Are you new to Python and frustrated with it? Is that where this is
coming from? If so, I am sorry that Python is so hard.
You can use Jython and get the Java VM or IronPython and get the CLR
VM. There's an immediate fix there for your objections to the CPython
VM. You could investigate getting some higher performance code going
using Stackless. Or move to event-based coding in Twisted and avoid
lots of while loop spins and locking/threading mischief and the other
things that come with network-bound programming like web development.
The PyPy project is also writing a fast Python intepreter with
multiple code output options. Or you can also profile your existing
code and optimize. Or integrate NumPy and Psyco into your efforts. And
you have the advantage of writing C extensions where it makes sense if
you're using CPython -- it's relatively easy and has resulted in fewer
than a dozen fatalities over the course of its existence. There are
options galore here, and 'Python' is actually a large, diverse
ecosystem. Web development is one thing Python does, but is not its
specialized purpose. PHP is a collection of tragic mistakes that
masquerades as a scripting language for the web.
I'd like to see some data on the response times of sites running
various Python web frameworks against each other and versus sites in
other languages. I'm also curious about the perception of speed versus
actual speed here -- if a site pushes 125k of page data a second at a
constant rate or pushes it all in 125k chunks in one second intervals,
the first is going to 'feel' faster initially even though both will
finish transferring the data at the same time and have identical page
load times. And if you're dealing with massive amounts of static
the wire one then yeah, the page is going to be slow ON FIRST LOAD but
from then on have 90% of what it needs in local cache, so subsequent
page loads will be smaller and faster. That appears to be the case
with ljworld, at least.
More information about the Python-list