Bite code
Bite code

Reputation: 596813

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 been fired, isn't it pointless ?

Upvotes: 4

Views: 1179

Answers (3)

John La Rooy
John La Rooy

Reputation: 304215

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.

Upvotes: 4

Stefan Ernst
Stefan Ernst

Reputation: 2781

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.

Upvotes: 4

Van Gale
Van Gale

Reputation: 43912

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.

Upvotes: 4

Related Questions