Personal tools
You are here: Home Products Plone Roadmap #92: Lazy initialization of TAL expressions in global_defines
Document Actions

#92: Lazy initialization of TAL expressions in global_defines

Contents
  1. Definitions
  2. Motivation
  3. Assumptions
  4. Proposal
  5. Deliverables
  6. Risks
by Christian 'Tiran' Heimes last modified June 11, 2006 - 00:22
ZPT has a undocumented feature to bind expressions lazy so they aren't evaluted unless used
Proposed by
Christian Heimes
Proposal type
Architecture
Repository branch
plip92-lazy-initialization
State
rejected

Definitions

lazy initialization: http://www.absoluteastronomy.com/encyclopedia/L/La/Lazy_initialization.htm

Motivation

global_defines slows down Plone because it defines lot's of vars which are used rarly

Assumptions

defer works well. Maybe it's undocumented for a reason?

Note: ZPT's engine needs a fix to make defer: work like expected. It's already fixed in the tiran-zpt-pydefer branch of zope

Proposal

Add defer: to all var definitions to use lazy initialization

Note: Because defer: in Zope 2.7.5 doesn't work as expected (broken inside python expressions, no caching after first evalution) I'm proposing a reimplementation with a new expression type "lazy:" based in defer

Deliverables

A fixed version of Zope (2.7.6/2.8?) or our own fixed implementation

Risks

defer: might break - needs testing

Speed up

Posted by Christian 'Tiran' Heimes at March 30, 2005 - 15:09

My bench marks are showing a general speed up of about 3-4%. I've used ab2 with 2000 requests and 2 concurrent requests. While the speed up itself isn't large the feature itself could be useful for other templates.

2-4% speed up is not worth it

Posted by Alan Runyan at April 2, 2005 - 02:15

we punt on this. we need to look for gains of 50% and above. We reject this.


For any issues with the web site functionality, please file a ticket.

Please consult the policy on plone.org content if you want your content published on this site.

Servers and hosting by