Expensive share queries called multiple times
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 36.9k
- Forks
- 5.2k
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 713
Description
While looking into performance optimizations around the deck share provider I noticed that its method to get the shares for a user is called twice when browsing the webdav directory that has those share mounts.
Two call stacks for the two callers, first from the mountpoint setup and then from the dav SharesPlugin:
This seems recently introduced in: https://github.com/nextcloud/server/pull/45698/files#diff-5947edd0e3a7f223b815d6508d2906e2ead1c15583df9e6a240bc2a4c150a2e3R102-R107
Now we should only call the individual providers once but I'm unsure where to best put in a caching layer and how.
@nickvergessen I assume the talk getSharedWith method is also not the lightest?
While I'm about to optimize the deck one a bit more, i think this is something we should think about how we can avoid calling this logic twice.
cc @artonge @skjnldsv as mostly related to sharing
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by comparing the two call stacks described for mountpoint setup and the DAV SharesPlugin, then review the referenced pull request that introduced the repeated provider calls. Determine where the individual provider results can be reused without changing behavior. Done means browsing the affected WebDAV directory invokes each provider only once.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- backend, performance
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100