-
-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cache the events from the 'Upcoming Events' portlet. #352
Conversation
@frapell thanks for creating this Pull Request and helping to improve Plone! TL;DR: Finish pushing changes, pass all other checks, then paste a comment:
To ensure that these changes do not break other parts of Plone, the Plone test suite matrix needs to pass, but it takes 30-60 min. Other CI checks are usually much faster and the Plone Jenkins resources are limited, so when done pushing changes and all other checks pass either start all Jenkins PR jobs yourself, or simply add the comment above in this PR to start all the jobs automatically. Happy hacking! |
@jenkins-plone-org please run jobs |
Hi, caching the results makes perfect sense. but the cache key calculation looks quite expensive by itself? Isn't there a way for a simpler cachekey? |
@petschki @thet Thanks for looking at this. Unfortunately, since this portlet is expected to show the upcoming events, the cached results should be void when there's a new event to show, and I cannot come up with a faster query to do this... Now, I don't think it is really a big issue, since it is simply a catalog call. I created a Plone site from scratch with 4000 events in the future, and an "Upcoming events" portlet at the root. here are some profiling details: While using this branch, I have profiled a first call (When the instance has just come up and you are issuing the very first request), and then a new profile for a second call without restarting the instance:
I repeated this using the master branch:
I am totally open to a better cachekey function, in case you have one. Attaching the profiles here, you can open them in https://www.speedscope.app/ |
Co-authored-by: Peter Mathis <[email protected]>
da0c3d9
to
fb52823
Compare
…event directly from the catalog.
fb52823
to
aa7a743
Compare
@frapell @petschki I have made a possible improvement for the cachekey. It queries only the latest modified event for all upcoming events and uses that to calculate the cachekey. It is the last commit on this branch and can easily be reverted. What is your opinion on this? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought so. Will revert to previous state and merge then. |
…y upcoming events, 2) querying for any IEvent based object.
I reverted to the previous logic with two changes:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
@jenkins-plone-org please run jobs |
@frapell that's now targeting Plone 6. If you need that for Plone 5 please backport it and I or petschki or someone else will approve it more quickly ... |
No description provided.