Page MenuHomeSoftware Heritage

Bypass edge restriction checks when edges=*
ClosedPublic

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

Diff Detail

Repository
rDGRPH Graph service
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

haltode created this revision.Jul 19 2019, 3:32 PM
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
haltode updated this revision to Diff 5907.Jul 19 2019, 4:20 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–25

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.

71–73

with the above proposal this method can go…

java/server/src/main/java/org/softwareheritage/graph/Neighbors.java
69

… and this becomes a null pointer check

This revision now requires changes to proceed.Jul 19 2019, 5:13 PM
haltode updated this revision to Diff 6014.Jul 29 2019, 10:06 AM

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

zack accepted this revision.Jul 29 2019, 10:34 AM
This revision is now accepted and ready to land.Jul 29 2019, 10:34 AM
haltode updated this revision to Diff 6015.Jul 29 2019, 10:43 AM

Rebasing on master

This revision was automatically updated to reflect the committed changes.