使用Psyco与django有什么意义吗?

时间:2022-02-11 06:56:47

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 ?

我知道Psyco对桌面应用程序的好处,但是在一个Web应用程序中,一个进程(=一个网页或一个AJAX调用)在被触发后立即死亡,这不是没有意义吗?

3 个解决方案

#1


4  

First, as gribbler and Ibrahim mentioned, your process won't die unless you are using pure CGI... which you shouldn't be using.

首先,正如抱抱者和易卜拉欣所提到的,除非你使用的是纯CGI,否则你的过程不会消亡......你不应该使用它。

Secondly, the bottleneck in most web apps are database queries, for which Psyco won't help.

其次,大多数Web应用程序的瓶颈都是数据库查询,Psyco对此无法提供帮助。

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.

如果您碰巧有一些计算密集的逻辑,那么使用Psyco或Cython肯定是有意义的。事实上,我在某个地方阅读了一份报告(很遗憾,现在已经有一段时间了,所以现在找不到链接),他正在做一些复杂的计算并且用Cython编译整个views.py的结果非常好。

#2


4  

You should be using fastcgi or wsgi with django, so the process won't be starting up for each request.

您应该使用fastcgi或wsgi与django,因此不会为每个请求启动进程。

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.

如果你想获得不错的收益,你真的需要把你的代码写成psyco友好的,如果你的瓶颈是数据库你就不会受益。

#3


3  

This guy got a performance increase out of it:

这个家伙的性能提升了:

http://www.alrond.com/en/2007/jan/25/performance-test-of-6-leading-frameworks/

http://www.alrond.com/en/2007/jan/25/performance-test-of-6-leading-frameworks/

It's a little bit outdated though.

虽然它有点过时了。

#1


4  

First, as gribbler and Ibrahim mentioned, your process won't die unless you are using pure CGI... which you shouldn't be using.

首先,正如抱抱者和易卜拉欣所提到的,除非你使用的是纯CGI,否则你的过程不会消亡......你不应该使用它。

Secondly, the bottleneck in most web apps are database queries, for which Psyco won't help.

其次,大多数Web应用程序的瓶颈都是数据库查询,Psyco对此无法提供帮助。

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.

如果您碰巧有一些计算密集的逻辑,那么使用Psyco或Cython肯定是有意义的。事实上,我在某个地方阅读了一份报告(很遗憾,现在已经有一段时间了,所以现在找不到链接),他正在做一些复杂的计算并且用Cython编译整个views.py的结果非常好。

#2


4  

You should be using fastcgi or wsgi with django, so the process won't be starting up for each request.

您应该使用fastcgi或wsgi与django,因此不会为每个请求启动进程。

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.

如果你想获得不错的收益,你真的需要把你的代码写成psyco友好的,如果你的瓶颈是数据库你就不会受益。

#3


3  

This guy got a performance increase out of it:

这个家伙的性能提升了:

http://www.alrond.com/en/2007/jan/25/performance-test-of-6-leading-frameworks/

http://www.alrond.com/en/2007/jan/25/performance-test-of-6-leading-frameworks/

It's a little bit outdated though.

虽然它有点过时了。