Page MenuHomeSoftware Heritage

Bypass edge restriction checks when edges=*
ClosedPublic

Authored by haltode on Jul 19 2019, 3:32 PM.

Diff Detail

Repository
rDGRPH Compressed graph representation
Branch
bypass-edge-check
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 6938
Build 9746: arc lint + arc unit

Event Timeline

zack requested changes to this revision.Jul 19 2019, 3:42 PM

I was more thinking of lifting this up to the traversal algo, ideally not having to do a test at every edge that is followed.
Done this way, this is not gonna gain you much, only a couple of array lookup per edge.

This revision now requires changes to proceed.Jul 19 2019, 3:42 PM

Move bypass check to Neighbors iterator upper-level class.

zack requested changes to this revision.Jul 19 2019, 5:13 PM
zack added inline comments.
java/server/src/main/java/org/softwareheritage/graph/AllowedEdges.java
19–26

This seems too convoluted: either you're bypassing restrictions or you need a boolean arrays for the restrictions.

So how about keeping the allowed array as a null if you're bypassing restrictions and getting rid of the boolean? (having both makes the code prone to bugs due to their mutual inconsistency).

In that case, please update the allowed docstring to mention the semantics of a null value.

75–77

with the above proposal this method can go…

java/server/src/main/java/org/softwareheritage/graph/Neighbors.java
69 ↗(On Diff #5907)

… and this becomes a null pointer check

This revision now requires changes to proceed.Jul 19 2019, 5:13 PM

Use special null value in boolean array to quickly bypass edge check when no
edge restriction is enforced.

This revision is now accepted and ready to land.Jul 29 2019, 10:34 AM
This revision was automatically updated to reflect the committed changes.