Does using Psyco with django make any sense?
I know the benefits of Psyco for a Desktop app, but in a Web app where a process ( = a web page or an AJAX call) dies immediately after开发者_StackOverflow been fired, isn't it pointless ?
First, as gribbler and Ibrahim mentioned, your process won't die unless you are using pure CGI... which you shouldn't be using.
Secondly, the bottleneck in most web apps are database queries, for which Psyco won't help.
If you happen to have a some logic that is computationally intensive it can certainly make sense to use Psyco or Cython. In fact I read a report somewhere (sorry it's been a while so can't find a link now) by someone who was doing some complex calculations and had great results compiling their entire views.py
with Cython.
This guy got a performance increase out of it:
http://www.alrond.com/en/2007/jan/25/performance-test-of-6-leading-frameworks/
It's a little bit outdated though.
You should be using fastcgi or wsgi with django, so the process won't be starting up for each request.
You really need to write your code to be psyco friendly if you want decent gains, and you will not benefit if your bottleneck is the database.
精彩评论