perf: cache shared view permission lookups#2586
Open
enjeck wants to merge 1 commit into
Open
Conversation
Signed-off-by: Enjeck C. <patrathewhiz@gmail.com>
blizzz
reviewed
May 11, 2026
| delete: $delete, | ||
| manage: $manage, | ||
| ); | ||
| $this->sharedPermissionsByNode[$cacheKey] = clone $permissions; |
Member
There was a problem hiding this comment.
clone should not be necessary, or do i oversee something?
| continue; | ||
| } | ||
| $sharedViews[$node['node_id']] = $this->find($node['node_id'], false, $userId); | ||
| $sharedViews[$node['node_id']] = $this->find($node['node_id'], true, $userId); |
Member
There was a problem hiding this comment.
Is this not needed through ViewController::indexSharedWithMe()?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This improves /apps/tables/view performance for users with shared views by avoiding repeated permission/share resolution during one request. Added request-local caching in PermissionsService for user group IDs, user circle IDs, shared permissions per user/node and context permissions per user/node.
To see the problem:
Now, the load time is improved.
Before: /apps/tables/view had slow startup, around 1.4s, with many repeated oc_tables_shares queries.
After: /apps/tables/view dropped to about 600ms. So we have a 2x speedup