Ticket #1800 (closed enhancement: fixed)

Opened 2 years ago

Last modified 1 year ago

Implement faster portlet lookup

Reported by: madarche Assigned to: madarche
Priority: P1 Milestone: CPS 3.4.4
Component: CPSPortlets Version: TRUNK
Severity: normal Keywords: optimization
Cc:

Description (Last modified by madarche)

The portlet lookup (as opposed to the portlet rendering) done by PortletsTool?.getPortlets is slow and called many times when a page is rendered. Tests have shown that one can reduce the page rendering time from around 1/3 of a second by improving this part.

The PortletsTool?.getPortlets method has been modified in a branch with the aim of caching the portlet lookup : http://svn.nuxeo.org/trac/pub/log/CPS3/products/CPSPortlets/branches/getPortletsCache/PortletsTool.py

This is just a first try at it and this needs to be finalized.

Things to be done

* Invalidate the cache at every portlet modification (createPortlet, deletePortlet, duplicatePortlet, movePortlet, insertPortlet). Maybe this could be simpler to plug the invalidation mechanism as an event subscriber.

* One should also think about the memory management (the 'rpath' parameter for example). JMO recommends a ZCacheable cache.

* JMO also recommends to deal with the other parameters (override, visibility_check, guard_check) otherwise the portlet editor might not work or more simply to not cache when visibility_check=False ou guard_check=False ou override=False ...

Change History

12/20/06 10:58:32 changed by madarche

But how would that be safe to use a ZCacheable cache when working with ZEO ? ZCacheable is not ZEO-safe according to Florent.

We were planing to implement a cache reset that should be honored by all ZEO clients by storing persistently at least the time of the last reset.

02/09/07 15:12:03 changed by madarche

  • description changed.

03/09/07 18:25:15 changed by madarche

  • status changed from new to closed.
  • resolution set to fixed.

Fixed by changeset [51315].

On a CPS default site the improvement is around 5% in page average rendering time.

And on a big web site featuring many portlets the improvement is of 16% in page average rendering time.

03/20/07 14:28:55 changed by madarche

  • keywords set to optmization.

03/20/07 15:26:24 changed by madarche

  • keywords changed from optmization to optimization.

05/07/07 17:25:04 changed by madarche

The following changesets add the profile support to add the cache on a portal : [51312], [51391].