[Zope-dev] Re: [Checkins] SVN: Zope/trunk/ Added LAZY_FILE_LOADING constant to PageTemplateFile. When set to True Page Template files aren't lo

Andreas Jung lists at zopyx.com
Sat Oct 20 05:29:49 EDT 2007



--On 20. Oktober 2007 11:20:09 +0200 Hanno Schlichting 
<plone at hannosch.info> wrote:

> Hi.
>
> Christian Theune wrote:
>> Cool,
>>
>> Am Dienstag, den 16.10.2007, 17:16 -0400 schrieb Hanno Schlichting:
>>> Log message for revision 80896:
>>>   Added LAZY_FILE_LOADING constant to PageTemplateFile. When set to
>>>   True Page Template files aren't lo aded and parsed on Zope startup
>>>   anymore, but on first access instead. When complex add-ons like Plon
>>>   e are installed this can safe up to 30% of the Zope startup time.
>>>   This gets a ZConfig switch ones I  figured out how to write one ;)
>>>
>>> Modified:
>>> Zope/trunk/lib/python/Products/PageTemplates/PageTemplateFile.py
>>> =================================================================== ---
>>> Zope/trunk/lib/python/Products/PageTemplates/PageTemplateFile.py
>>> 	2007-10-16 20:12:30 UTC (rev 80895) +++
>>> Zope/trunk/lib/python/Products/PageTemplates/PageTemplateFile.py
>>> 	2007-10-16 21:16:07 UTC (rev 80896) @@ -31,6 +31,8 @@
>>>
>>>  LOG = getLogger('PageTemplateFile')
>>>
>>> +LAZY_FILE_LOADING = False
>>> +
>>>  def guess_type(filename, text):
>>
>>
>> Hmm. Maybe an option that can actually be configured would be better?
>> What about adding an option to zope.conf?
>>
>> And why don't we enable it by default? At least for debug mode?
>
> After looking at this again, I realized that the zope.pagetemplates
> version does not load the file content on __init__ at all.
>
> I would suggest to change the Products.PageTemplates version in the same
> way, making lazy loading the default, without any configurable option.
>
> Thoughts?


I would say: go ahead.

Andreas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 186 bytes
Desc: not available
Url : http://mail.zope.org/pipermail/zope-dev/attachments/20071020/b029c4c8/attachment.bin


More information about the Zope-Dev mailing list