Repository navigation
Restore shared anonymous authorization lookup per object (fixes #6257 performance regression) - #6544
Open
bram-atmire wants to merge 1 commit into
Open
bram-atmire wants to merge 1 commit into
bram-atmire wants to merge 1 commit into
Conversation
Since 6f52262, each anonymous feature check rebuilt the unfiltered authorization search and resolved every embedded feature again, even when another check on the same object had already done so. On an item page with many bitstreams this repeated work for every feature checked on every bitstream, making server-side rendering and hydration slower than before DSpace#6257. Restore the per-object shared lookup from 3a45c31 in a commented form: all checks on an object reuse one observable of granted feature IDs until it expires with the underlying response or the authorization cache is invalidated. Failed lookups are dropped so the next check retries them, and expired entries are pruned. Assisted-by: Claude Code [claude-opus-5-5]
4 of 13 tasks
Contributor
|
I can confirm that this PR resolves the performance problems introduced by #6257. Response time average dropped from 2490.02ms to 1829.36ms again 👍 |
Member
|
@artlowel or @FrancescoMolinaro : Alerting you to this PR as it's a performance fix followup to #6257 (which you both reviewed & approved). If either of you have time to give this a look, it may be good to get this merged quickly to resolve the performance issues. |
FrancescoMolinaro
approved these changes
Nov 23, 2026
FrancescoMolinaro
left a comment
Contributor
There was a problem hiding this comment.
Hi @bram-atmire , thanks for your work on this, I have tested the changes and it looks good to me!
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.
References
Description
The final commit of #6257 (6f52262) dropped the shared per-object lookup from 3a45c31. Requests stayed the same, but every anonymous feature check resolved the object's authorizations again, which on items with many bitstreams made page loads slower than before #6257. This restores the shared lookup.
Instructions for Reviewers
AuthorizationDataServiceshares one lookup of granted feature IDs per object between all anonymous checks on it.invalidateAuthorizationsRequestCache(), and failed lookups are retried. Expired entries are pruned.Median LCP, item with 50 bitstreams (
item.bitstream.pageSize: 50,showAccessStatuses: true, server-side caches off), 100 page loads per variant, headless Chromium:mainbefore #6257 vs after #6257mainbefore #6257 vs this PREach row is a separate run with both variants interleaved, so compare within a row only. The first row was measured right after starting the backend, while it was still warming up (JIT, Hibernate and database caches); the second row ran with a warm backend. That is why the same pre-#6257 baseline measures 1530 ms in one row and 1196 ms in the other.
To test: load such an item anonymously and compare page load with current
main. REST requests are unchanged.AI Disclosure (REQUIRED)
Were AI tools used in the creation of this PR?
Claude Code (claude-opus-5-5) reproduced the regression, wrote the fix and specs, ran the benchmarks and drafted this description. Human review didn't reveal additional flaws or mistakes.
Checklist
mainbranch of code (unless it is a backport or is fixing an issue specific to an older branch).npm run lintnpm run check-circ-deps)package.json), I've made sure their licenses align with the DSpace BSD License based on the Licensing of Contributions documentation.