Skip to content

ReBAC: Optimisation strategies#99

Merged
uatuko merged 7 commits intomainfrom
feature/rebac-optimize-strategies
May 15, 2024
Merged

ReBAC: Optimisation strategies#99
uatuko merged 7 commits intomainfrom
feature/rebac-optimize-strategies

Conversation

@uatuko
Copy link
Copy Markdown
Owner

@uatuko uatuko commented May 14, 2024

Allow different optimisation strategies to be used when creating relations.

uatuko added 3 commits May 14, 2024 13:43
There are two main changes here.
1. Rename `optimise` -> `optimize` (so we don't mix US and UK
   spellings).
2. Change the `optimize` boolean flag to a `uint32`, which can be used
   to indicate which optimization strategy to use.
@uatuko uatuko mentioned this pull request May 14, 2024
14 tasks
@codecov
Copy link
Copy Markdown

codecov bot commented May 14, 2024

Codecov Report

Attention: Patch coverage is 84.00000% with 4 lines in your changes are missing coverage. Please review.

Project coverage is 92.85%. Comparing base (c7a50d3) to head (71eecd3).

Files Patch % Lines
src/svc/relations.cpp 84.00% 1 Missing and 3 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #99      +/-   ##
==========================================
- Coverage   92.90%   92.85%   -0.06%     
==========================================
  Files          18       18              
  Lines        1128     1148      +20     
  Branches      126      133       +7     
==========================================
+ Hits         1048     1066      +18     
- Misses         61       62       +1     
- Partials       19       20       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

neculalaura
neculalaura previously approved these changes May 14, 2024
Copy link
Copy Markdown
Collaborator

@neculalaura neculalaura left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you explain a bit this optimising strategy? can talk about it tomorrow 🙂

// of computed relations resulting in expensive write operations.
// 4 (graph) - Don't optimize. Lookups will need to use a graph traversal algorithm to derive
// relations.
// 8 (set) - Optimize by computing derived relations between principals, which the lookups
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why 2 4 8?

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mainly to leave some numbers in-between so there's space to add other strategies or variations of strategies if needed.

@uatuko uatuko marked this pull request as ready for review May 15, 2024 06:27
@uatuko uatuko merged commit d49eaa4 into main May 15, 2024
@uatuko uatuko deleted the feature/rebac-optimize-strategies branch May 15, 2024 20:05
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.

2 participants