You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have a site which currently has +1500 events, and the customer has put 2 Upcoming Events portlets in its homepage.
End result, loading time takes about 12 seconds.
In trying to figure out what was happening, I used py-spy which showed get_events and in particular filter_and_resort appear to be quite CPU intensive. And with more and more events being added almost daily, it is only going to get worse.
I don't know if these methods can be made to perform much faster, however In order to try and mitigate the performance hit, I am patching the portlet events method and using the @ram.cache decorator from plone.memoize to cache the results, using a key based on a way cheaper portal_catalog call that will be different if the events that are likely to be shown in the portlet are modified, thus making it void and having the events to be recomputed. This improvements makes the homepage to now take 1 second to load.
I am submitting this fix in a PR, in case this sounds useful to be included with the portlet.
The text was updated successfully, but these errors were encountered:
We have a site which currently has +1500 events, and the customer has put 2
Upcoming Events
portlets in its homepage.End result, loading time takes about 12 seconds.
In trying to figure out what was happening, I used
py-spy
which showedget_events
and in particularfilter_and_resort
appear to be quite CPU intensive. And with more and more events being added almost daily, it is only going to get worse.I don't know if these methods can be made to perform much faster, however In order to try and mitigate the performance hit, I am patching the portlet
events
method and using the@ram.cache
decorator fromplone.memoize
to cache the results, using a key based on a way cheaperportal_catalog
call that will be different if the events that are likely to be shown in the portlet are modified, thus making it void and having the events to be recomputed. This improvements makes the homepage to now take 1 second to load.I am submitting this fix in a PR, in case this sounds useful to be included with the portlet.
The text was updated successfully, but these errors were encountered: