-
-
Notifications
You must be signed in to change notification settings - Fork 66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use petgraph inside DefaultRoleManager to model relations #293
Conversation
This relation model is built after the Go implementation, but uses edges inside the graph to model relations instead of having each role store pointers in maps. Edges with the `EdgeVariant::Link` are relations which in Go are modeled by the `roles` and `users` map. Edges with the `EdgeVariant::Match` are relations which is Go are modeled by the `matched` and `matchedBy` map. This change brings significant speedups in benchmarks when compared against the master branch. Co-authored-by: valkum <r.floren@heinlein-video.de>
@smrpn @hackerchai @PsiACE @GopherJ please review |
@kbalt fix: |
Codecov Report
@@ Coverage Diff @@
## master #293 +/- ##
==========================================
+ Coverage 81.02% 81.52% +0.49%
==========================================
Files 23 23
Lines 3342 3480 +138
==========================================
+ Hits 2708 2837 +129
- Misses 634 643 +9
Continue to review full report at Codecov.
|
Great, thank you very much for your contribution! I will check it tomorrow, can you let ci pass first? |
@PsiACE Any updates on this? |
I apologise for some changes in my role that caused me to forget to give feedback earlier. The PR looks great and I will be approving it. But before we merge, I'd like @hackerchai to help review it again. |
LGTM |
This relation model is built after the Go implementation, but uses edges inside the graph to model relations instead of having each role store pointers in maps.
Edges with the
EdgeVariant::Link
are relations which in Go are modeled by theroles
andusers
map.Edges with the
EdgeVariant::Match
are relations which is Go are modeled by thematched
andmatchedBy
map.This change brings significant speedups in benchmarks when compared against the master branch.