RE: [Zope] Superfast PageTemplates: Call for expertise
In know this is purely speculation, but what about caching page-templates in some intermediate format like ESIS, and writing a lexical scanner for the TALES structure in C/Flex with callbacks to Python for code evaluation and object traversal? Obviously, this isn't trivial, but I imagine it would be interesting... Sean -----Original Message----- From: Dieter Maurer [mailto:dieter@handshake.de] Sent: Tuesday, February 18, 2003 1:45 PM To: Peter Bengtsson Cc: zope@zope.org Subject: Re: [Zope] Superfast PageTemplates: Call for expertise Peter Bengtsson wrote at 2003-2-17 22:57 +0000:
... My product uses PageTemplates (mostly through PageTemplateFile) and the PageTemplate stuff really goes at the top of the CPU timing. I.e. the PageTemplate rendering is "slow". DTML is probably not faster
DTML is much faster...
and I'm not "blaming" PageTemplates as such because I understand that they have a lot of work to do.
My question is: How do I ease off the load on PageTemplate rendering?
What in TAL should generally be avoided, if possible, to gain that extra performance?
The slowest part for a PageTemplate is its parsing... Avoid doing it more than once.
Are there any particular constructions that are "bad" to do with TAL syntax/formatting?
I do not think so.
(I've heard that METAL is "slow" but they're difficult to avoid because of their great functionality)
I cannot confirm this. Someone started to code PageTemplates in C. I think, I read something about this in the "xml-sig" mailing list. A little less drastic would be to replace the "HTMLParser" and use, e.g. "sgmlop". Dieter _______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
At 02:55 PM 2/18/2003, sean.upton@uniontrib.com wrote:
In know this is purely speculation, but what about caching page-templates in some intermediate format like ESIS, and writing a lexical scanner for the TALES structure in C/Flex with callbacks to Python for code evaluation and object traversal?
You could probably do 90% of that by stuffing layout fragments into RAM Caches and Session data... and then you could assemble the whole thing on the fly using DTML... oh, wait. :-) More seriously, it'll be great when the ZC/Squid ESI project becomes available. That should serve this purpose nicely. Dylan
At 14:55 2003-02-18 -0800, sean.upton@uniontrib.com wrote:
In know this is purely speculation, but what about caching page-templates in some intermediate format like ESIS, and writing a lexical scanner for the TALES structure in C/Flex with callbacks to Python for code evaluation and object traversal? Obviously, this isn't trivial, but I imagine it would be interesting...
Thanks for the tips but the only words I understood in that was TALES and Python. No, I think it sounds like too much work for me, but thanks anyways. Peter
Sean
-----Original Message----- From: Dieter Maurer [mailto:dieter@handshake.de] Sent: Tuesday, February 18, 2003 1:45 PM To: Peter Bengtsson Cc: zope@zope.org Subject: Re: [Zope] Superfast PageTemplates: Call for expertise
Peter Bengtsson wrote at 2003-2-17 22:57 +0000:
... My product uses PageTemplates (mostly through PageTemplateFile) and the PageTemplate stuff really goes at the top of the CPU timing. I.e. the PageTemplate rendering is "slow". DTML is probably not faster
DTML is much faster...
and I'm not "blaming" PageTemplates as such because I understand that they have a lot of work to do.
My question is: How do I ease off the load on PageTemplate rendering?
What in TAL should generally be avoided, if possible, to gain that extra performance?
The slowest part for a PageTemplate is its parsing...
Avoid doing it more than once.
Are there any particular constructions that are "bad" to do with TAL syntax/formatting?
I do not think so.
(I've heard that METAL is "slow" but they're difficult to avoid because of their great functionality)
I cannot confirm this.
Someone started to code PageTemplates in C. I think, I read something about this in the "xml-sig" mailing list.
A little less drastic would be to replace the "HTMLParser" and use, e.g. "sgmlop".
Dieter
_______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
sean.upton@uniontrib.com wrote at 2003-2-18 14:55 -0800:
In know this is purely speculation, but what about caching page-templates in some intermediate format like ESIS,
This is already done, although the format is not ESIS.
and writing a lexical scanner for the TALES structure in C/Flex with callbacks to Python for code evaluation and object traversal? Obviously, this isn't trivial, but I imagine it would be interesting...
"sgmlop" would seem to be ideal. It knows SGML and XML and is very fast. Drawback: its an additional external component. Dieter
participants (4)
-
Dieter Maurer -
Dylan Reinhardt -
Peter Bengtsson -
sean.upton@uniontrib.com