[Zope-dev] Re: Possible performance problem in Page Template engine?
Ok, little correction here: I used ploneout on plone-trunk and it then uses Zope trunk and thus 2.11. This problem seems to be a new problem coming from refactoring: r78767 | andreasjung | 2007-08-12 12:55:45 +0200 (So, 12 Aug 2007) | 4 lines - Collector #2339: ZPT: fixed unicode issue when using the 'structure' directive - ZopeContext: added evaluateStructure() and refactored _handleText() in order to deal with unicode issues when using the 'structure' directive -- christian ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
[Zope-dev] Possible performance problem in Page Template engine?
Hi everybody! When I was trying to fix portlets in Plone I was wondering why the render() method of my portlet actually gets called multiple times. After a bit of investigation I ended up in the Five product in browser/providerexpressions.py where provider expressions also seem to be called twice for each provider statement. The problem seems to be in Products/PageTemplates/Expressions.py in line 199/200 (in Zope 2.10.4): def evaluateStructure(self, expr): """ customized version in order to get rid of unicode errors for all and ever """ text = super(ZopeContext, self).evaluateStructure(expr) return self._handleText(text, expr) This construct seems to evaluate expr twice. One time in evaluateStructure() of the super class which is basically a call to self.evaluate(expr) (to be found in zope/tales/tales.py around line 713: def evaluateStructure(self, expr): return self.evaluate(expr) and then again in _handleText(): def _handleText(self, text, expr): text = self.evaluate(expr) ... I now tried to remove the evaluation of expr in handleText() and in a very simple test using ab on my site I got twice the speed! I might be missing something here of course but if every expression is evaluated twice then this is of course huge performance drain. And of course this fix was just a quick idea without much understanding of the underlying engine (e.g. not knowing if _handleText() is also called from somewhere else etc.) So any Page Template experts here who can confirm this? cheers, Christian -- Christian Scholz video blog: http://comlounge.tv COM.lounge blog: http://mrtopf.de/blog Luetticher Strasse 10Skype: HerrTopf 52064 Aachen Homepage: http://comlounge.net Tel: +49 241 400 730 0 E-Mail [EMAIL PROTECTED] Fax: +49 241 979 00 850 IRC: MrTopf, Tao_T connect with me: http://mrtopf.de/connect ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
[Zope-dev] Zope Tests: 5 OK
Summary of messages to the zope-tests list. Period Thu Oct 25 12:00:00 2007 UTC to Fri Oct 26 12:00:00 2007 UTC. There were 5 messages: 5 from Zope Unit Tests. Tests passed OK --- Subject: OK : Zope-2.7 Python-2.3.6 : Linux From: Zope Unit Tests Date: Thu Oct 25 20:51:26 EDT 2007 URL: http://mail.zope.org/pipermail/zope-tests/2007-October/008546.html Subject: OK : Zope-2.8 Python-2.3.6 : Linux From: Zope Unit Tests Date: Thu Oct 25 20:52:56 EDT 2007 URL: http://mail.zope.org/pipermail/zope-tests/2007-October/008547.html Subject: OK : Zope-2.9 Python-2.4.4 : Linux From: Zope Unit Tests Date: Thu Oct 25 20:54:26 EDT 2007 URL: http://mail.zope.org/pipermail/zope-tests/2007-October/008548.html Subject: OK : Zope-2.10 Python-2.4.4 : Linux From: Zope Unit Tests Date: Thu Oct 25 20:55:56 EDT 2007 URL: http://mail.zope.org/pipermail/zope-tests/2007-October/008549.html Subject: OK : Zope-trunk Python-2.4.4 : Linux From: Zope Unit Tests Date: Thu Oct 25 20:57:27 EDT 2007 URL: http://mail.zope.org/pipermail/zope-tests/2007-October/008550.html ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )