[Zope] RFC: Flaws in Structured text

Pavlos Christoforou pavlos@gaaros.com
Mon, 13 Mar 2000 10:30:43 -0500 (EST)


On Mon, 13 Mar 2000, Itamar Shtull-Trauring wrote:

> Would using re (so it can take advantage of multithreading) make up for a
> more complicated rendering engine?
> 

Hmm I hear the new re module of python1.6 is fast .. so a migration to re
might be a good idea.

> 
> This wouldn't work in all cases - consider <dtml-var ZopeTime>, where the
> output changes every time it's called.  If an object contains only
> strucutred text then you store the rendered text too, and update it every
> time the input text changes - the PTK has an object that does this.

If a block of structured text contains dynamic content then you are right,
caching won't work, but in many cases structured text documents contain
only static text. It does not harm to cache unless you have many stx docs
and little memory. I haven't checked PTK yet but in Zpdf Document the
rendered output is cached in a volatile attribute together with a fast
checksum on the input text. Works quite well and ZODB takes care of
garbage collection during object deactivation.

Pavlos