-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
fix(taskprocessing): More caching #50331
Conversation
59e1551
to
258df9e
Compare
) { | ||
$this->appData = $appDataFactory->get('core'); | ||
$this->cache = $cacheFactory->createLocal('task_processing::'); |
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.
distributed cache would be good here too, it falls back to local cache if unavailable
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 believe we can't use distributed cache here because it uses json_encode to serialize the values and that breaks stuff
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.
apcu will serialize faithfully, afaik
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.
we can probably handle the json_encode ourselves and pass the validated result only to the cache but feel free to use local only, won't affect it much
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.
At least the result of getAvailableTaskTypes(
should be string-array only? So should be totally fine?
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.
Small comment regarding local vs distributed cache.
Local cache should typically be better for performance because it has lower latency. The distributed cache leaves the machine, at least for clustered setups with a dedicated Redis node.
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.
At least the result of getAvailableTaskTypes( should be string-array only?
It's not, sadly
/backport to stable31 |
/backport to stable30 |
Cypress failure seems unrelated |
Together with nextcloud/app_api#500 this shaves 150ms off getNextScheduledTask on my machine |
0c393bf
to
028e6e2
Compare
Quite a serious figure, excellent optimization! |
028e6e2
to
fa4bd44
Compare
…quests Signed-off-by: Marcel Klehr <[email protected]>
Signed-off-by: Marcel Klehr <[email protected]>
Signed-off-by: Marcel Klehr <[email protected]>
…well Signed-off-by: Marcel Klehr <[email protected]>
Co-authored-by: Julien Veyssier <[email protected]> Signed-off-by: Marcel Klehr <[email protected]>
Signed-off-by: Marcel Klehr <[email protected]>
fa4bd44
to
a610002
Compare
Summary
Shave off some miliseconds.
Checklist