[Zope] How a WebSite works using Zope?

Shane Hathaway shane@zope.com
Tue, 21 May 2002 21:35:27 -0400 (EDT)


On Tue, 21 May 2002, Chris Withers wrote:

> Shane Hathaway wrote:
> >
> > Right.  Here at ZC, we always favor page templates over DTML for HTML
> > page generation, so if there really is a performance issue, we'll have
> > to face it and fix it.  Besides, I have my doubts that there really is
> > an issue. ;-)
>
> What, aside from the fact that ZPT is demonstrably slower than DTML?

It's only demonstrably slower for simplistic tests.  Because TALES is more
explicit, the expressions you use in ZPT tend to be more efficient than
DTML.  I can't say whether ZPT is thus faster than DTML, but I think ZPT
provides more opportunities for optimization.

A simple example is "request/foo" vs. "<dtml-with REQUEST><dtml-var
foo></dtml-with>".  ZPT grabs the name "request" from a dictionary, then
gets an attribute called "foo".  DTML searches the entire acquisition path
to find REQUEST, puts it at the top of the namespace, gets an attribute
called "foo", then pops the topmost namespace.

If speed really is a concern, the current page templates are a bit
wasteful in a couple of spots and someone could look at cleaning them up.
For example, we use the "Script" base class, which drags in bindings, but
bindings aren't needed!

Shane