Skip to content

perf: cache authorized-group delegation lookups#59328

Draft
solracsf wants to merge 1 commit intomasterfrom
perfCacheAuthorizedGroupLookups
Draft

perf: cache authorized-group delegation lookups#59328
solracsf wants to merge 1 commit intomasterfrom
perfCacheAuthorizedGroupLookups

Conversation

@solracsf
Copy link
Copy Markdown
Member

@solracsf solracsf commented Mar 31, 2026

Summary

Repeated group-backend and DB queries on every #[AuthorizedAdminSetting] request, every share formatting call, and every group-membership hook are replaced by scoped caches (per-request arrays, a two-tier local+distributed cache, and a per-instance memoization property). All four write paths on authorized_groups invalidate the cache through AuthorizedGroupService, which now batches N mutations into a single clearCache() call.

A UNIQUE constraint on group_id is added via migration, closing a concurrent-write race that the previous applicative pre-check could not cover. Duplicate rows on existing instances are cleaned up in preSchemaChange() before the index is created.

Checklist

AI (if applicable)

  • The content of this PR was partly or fully generated using AI

@solracsf solracsf force-pushed the perfCacheAuthorizedGroupLookups branch from d4e31d5 to 7671a5c Compare March 31, 2026 09:24
Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>
@solracsf solracsf force-pushed the perfCacheAuthorizedGroupLookups branch from ee331fb to 953b44b Compare March 31, 2026 12:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant