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 been fired, isn't it pointless ?
-
Err, does a process really die just after being fired? I thought usually mod_python lives as long as the server process lives. – Ibrahim Oct 26 '09 at 07:52
-
Important to note that psyco only works on 32-bit machines. So if you are developing locally on a 32-bit machine, and deploying on a 64-bit machine, it will not work. (plus I total agree with Van Gale's answer) – John Paulett Oct 28 '09 at 02:28
3 Answers
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.

- 295,403
- 53
- 369
- 502
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.

- 43,536
- 9
- 71
- 81
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.

- 2,781
- 4
- 25
- 34