Ticket #1800 (closed enhancement: fixed)

Opened 13 years ago

Last modified 13 years ago

Implement faster portlet lookup

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

Description (last modified by madarche) (diff)

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

comment:1 Changed 13 years ago 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.

comment:2 Changed 13 years ago by madarche

  • Description modified (diff)

comment:3 Changed 13 years ago 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.

comment:4 Changed 13 years ago by madarche

  • Keywords optmization added

comment:5 Changed 13 years ago by madarche

  • Keywords optimization added; optmization removed

comment:6 Changed 13 years ago by madarche

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

Note: See TracTickets for help on using tickets.