[Framework-Team] Re: Performance — as usual

Philipp von Weitershausen philipp at weitershausen.de
Mon Nov 13 10:20:56 UTC 2006


Alexander Limi wrote:
> On Sun, 12 Nov 2006 20:57:17 -0800, Alexander Limi 
> <limi at plone.org> wrote:
> 
>> *goes to check more in-depth with PTProfiler*
> 
> PTProfiler seems to be broken with Plone 3.0 — probably because Zope 
> 2.10 uses the Zope 3 implementation of Page Templates now —

Yes, and because PTProfiler monkeys around which is basically asking for 
forward-compatibility problems.

> anybody know if this is hard to fix? (Traceback when loading a page
> after enabling PTProfiler below, hi to Philipp and Guido, maybe you
> know what this is? :)
> 
> PTProfiler is a must-have tool for finding slowdowns in application 
> code, and it would suck if we couldn't make use of it with Zope 2.10.
> 
> 
> Traceback (innermost last):
...
>   Module Products.PTProfiler.ProfilerPatch, line 22, in __patched_call__
>   Module Products.PTProfiler.ProfilerPatch, line 49, in _get_expr
> AttributeError: 'PythonExpr' object has no attribute 'expr'

 From the looks of it, 'PythonExpr' expressions used to store the 
expression string in the 'expr' attribute, in Zope 2.10 it stores it in 
the 'text' attribute.

There are two options for fixing this:

* treating this as a bug of PTProfiler, and subsequently making 
PTProfiler aware of the 'text' attribute when running on Zope 2.10

* treating this as a BBB foul of Zope 2.10, and subsequently making 
PythonExpr also store the 'expr' attribute (it still needs to store the 
'text' attribute because that's what Zope 3's implementation fo 
'PythonExpr' wants). See attached patch.

Even though PTProfiler monkeys and that can never be guaranteed to be 
forward-compatible, I'm still leaning towards the secound solution. 
Anyone with Zope commit privileges is welcome to commit the patch (or 
you can open a bug in the collector and assign it to me -- but there's 
no guarantee that I can get around it this week).

Note that unless you're running off of the SVN tree or apply the patch 
locally, you won't see the fix until a 2.10.1 release (which is supposed 
to happen soonish ~= next weekend). In case of the first solution, you 
could have a workaround within minutes, provided someone makes a new 
PTProfiler release.

HTH
Philipp


-- 
http://worldcookery.com -- Professional Zope documentation and training
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: ptprofiler.patch
URL: <http://lists.plone.org/pipermail/plone-framework-team/attachments/20061113/0c7182bf/attachment.ksh>


More information about the Framework-Team mailing list