[Zope] My Way of Zope Programming

Jim Penny jpenny@universal-fasteners.com
Fri, 9 Aug 2002 10:41:51 -0400


On Thu, Aug 08, 2002 at 11:52:06PM -0500, Ausum Studio wrote:
> I came up to the idea that for people wanting to use Zope for high
> trafficked sites, and thus are looking for every bit of performance out of
> their web applications, ZPT would probably may not be a choice at all.
> 
> I've recently tested Plone (the CMF skin built entirely of ZPTs) on a
> Pentium IV @ 1.7GHZ plenty of memory, and generally speaking I had this
> sensation that in despite of that horsepower, every page took a little bit
> of time to render while some pages took from half a second to two seconds.
> (DTML based pages, no matter how complicated they were, rendered almost
> immediately ). Now, take that and multiply it for 20 or more simultaneus hit
> responses and you'll find out that you'll need more horsepower than the
> average in order to provide a pleasant session for all the users.
> 

On the contrary, I suspect that it is Plone's fault.  The javascript
suggestion may be reasonable.  I am doing heavy database backed work
(technical drawings, request for samples, drawings, items, catalog
photos, etc.)  I find that a simple form involving about three database
queries is taking between .2 and .5 seconds to render.  This really
makes me think that ZPT is not the hangup.  Moreover, my older sections,
which are DTML, seem to take roughly the same time.

My personal guess, without doing heavy instrumentation, is that ZPT is
a bit slower than DTML, but that the separation of logic into snake
thingies roughly offsets that.  I am not using METAL much, so I have no
idea of what that does to speed.

(Server is a K6-450, linux 2.2.13, database is postgresql, DA PoPy)

> By the way it's not Plone's fault. I see ZPT more like a marketing strategy
> and hence the closing of the gap between designers and programmers looks
> like a huge selling point ( provided other less elegant scripting languages
> like PHP do have more attention than Zope/DTML/ZPT/Python  from web design
> suites like Dreamweaver.) Of course in the future, when computing power
> wouldn't be a concern, this effective separation of code and html will be a
> key feature.

This is the sales pitch.  I wish Zope Corp would get over it!  The real
benefit of ZPT, even for "non designer" sites, is that path expressions
make it much easier to use the same form for entry and error handling,
in a fairly readable manner.  That is, DTML design encouraged a model of
present initial form; error check; (present error form or handle).

ZPT encourages a view of present initial form; error check; (re-present
form or handle).

This make it easier to evolve the site, since you don't have to maintain
two different forms in lock-step.

Yes, I am aware that the same could have been done in DTML.  But placing
datasource logic in DTML tended to quickly devolve into a unreadable
morass, so that it was easier to maintain two separate methods.

Jim Penny


> 
> Just my two cents.
> 
> 
> 
> Ausum