Closed uatuko closed 5 months ago
Attention: Patch coverage is 88.88889%
with 2 lines
in your changes missing coverage. Please review.
Project coverage is 93.17%. Comparing base (
bef3937
) to head (c83821e
).
Files | Patch % | Lines |
---|---|---|
src/svc/relations.cpp | 88.88% | 0 Missing and 2 partials :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
This is a slight optimisation to reduce the BFS graph traversal cost with the expectation that the graph is narrower on the left and wider on the right. Most of the time this would be the case if principals are on the left.
e.g. In the following example, to check
user:jane -> reader -> doc:notes.txt
with left to right BFS will require 10003 lookups whereas right to left will only take 3 lookups.Benchmarks
Before
``` ------------------------------------------------------------------------------------------- Benchmark Time CPU Iterations UserCounters... ------------------------------------------------------------------------------------------- bm_relations/check_graph/4/128 25076263 ns 3086440 ns 100 ops=323.998/s vertices=126.359k/s bm_relations/check_graph/8/128 57364218 ns 7036899 ns 99 ops=142.108/s vertices=128.75k/s bm_relations/check_graph/32/128 259431654 ns 33223300 ns 10 ops=30.0994/s vertices=120.458k/s bm_relations/check_graph/4/512 101723773 ns 12166667 ns 57 ops=82.1918/s vertices=126.74k/s bm_relations/check_graph/8/512 237103853 ns 27974560 ns 25 ops=35.7468/s vertices=128.474k/s bm_relations/check_graph/32/512 1078407325 ns 137229800 ns 5 ops=7.28705/s vertices=115.908k/s bm_relations/check_graph/4/2048 421086234 ns 51664538 ns 13 ops=19.3556/s vertices=119.037k/s bm_relations/check_graph/8/2048 974933250 ns 118474000 ns 6 ops=8.44067/s vertices=121.09k/s bm_relations/check_graph/32/2048 4466643000 ns 611284000 ns 1 ops=1.6359/s vertices=103.916k/s ```