Write web apps in Python?

Adam Tauno Williams awilliam at whitemice.org
Tue Apr 20 14:40:04 CEST 2010

On Mon, 2010-04-19 at 15:15 +0200, Bruno Desthuilliers wrote:
> Gilles Ganault a écrit :
> > On Thu, 15 Apr 2010 12:41:56 +0200, Bruno Desthuilliers
> > <bruno.42.desthuilliers at websiteburo.invalid> wrote:
> >> The PHP execution model (mostly based on CGI FWIW) tends to be a bit 
> >> unpractical for non-trivial applications since you have to rebuild the 
> >> whole world for each and any incoming request, while with a long-running 
> >> process, you load all your libs, parse your config etc only once.

There are numerous ways to efficiently retains state between page views
[session id + memcache or even just shared memory].

> > Apart from the ease of having the application run at all times, I'd be
> > curious to read about an application that was written in PHP and then
> > a long-running process and see if performance improved.
> I'm not sure there's a way to do such a thing in PHP,

There isn't.  [Speaking as an ~15 year administrator and developer].
Also PHP's memory management is *B*A*D*, so please don't try to create
long running processes in PHP.

But if you have intensive processing to do your web front end should
signal a backend to do the 'real' work;  keeping your front end thin and
svelt.  There are numerous ways to accomplish that.

> Now there are a couple Symfony / Django benchmarks around (Symfony being 
> probably the closest thing to Django in the PHP world). They are just as 
> reliable as most benchmarks (that is, at best a rough indicator once you 
> understand what's effectively being measured), but it seems that they 
> confirm the empirical evidence that PHP is not well suited for such 
> "heavy" OO frameworks.
> > Regardless, Python has an easier syntax, so AFAIC, that's already a
> > good enough reason to use this to write web apps.
> Indeed !-)

More information about the Python-list mailing list