Skip to content

Workspace relationships performance#784

Open
jsbroks wants to merge 1 commit intomainfrom
cursor/workspace-relationships-performance-68e9
Open

Workspace relationships performance#784
jsbroks wants to merge 1 commit intomainfrom
cursor/workspace-relationships-performance-68e9

Conversation

@jsbroks
Copy link
Member

@jsbroks jsbroks commented Feb 5, 2026

Optimizes relationship computation by improving cache efficiency and speeding up FindRemovedRelations.

Relationship computation was slow due to inefficient cache building and an O(n²) algorithm for finding removed relations. This PR addresses these by:

  • Avoiding CEL entity-map cache construction for non-CEL rules.
  • Scoping entity-map cache building to only the from and to entity sets, with ID deduplication, to reduce JSON conversion overhead.
  • Refactoring FindRemovedRelations to use a key set, changing its complexity from O(n²) to O(n).
    A benchmark for FindRemovedRelations and a test for cache deduplication have been added to validate these improvements.

Open in Cursor Open in Web

Co-authored-by: Justin Brooks <jsbroks@gmail.com>
@cursor
Copy link

cursor bot commented Feb 5, 2026

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 5, 2026

Warning

Rate limit exceeded

@jsbroks has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 4 minutes and 29 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch cursor/workspace-relationships-performance-68e9

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@jsbroks jsbroks marked this pull request as ready for review February 5, 2026 05:49
@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants