I saw a 37% heap memory reduction and a slight performance improvement with ShiftLeft Vs. TinkerGraph.
Loading 6,899,377 lines of a data set of tower,device association. Creates 1,524,870 vertices, 6,899,377 edges.
Towers created with 'g.addV("tower").property("towerId", towerId)' and then cached for future reference.
Devices created with 'g.addV("device").property("deviceId", deviceId)' and then cached for future reference.
Edges created with g.V(tower).addE("link").to(__.V(device)).iterate();
TinkerGraph: 107s
Specialized: 103s
Running shortest path for 267 towers to select 10 devices:
Setup:
// mark 10 random devices
g.V().hasLabel("device").sample(10).property("target", true)
// create edges between transitively connected towers to reduce paths
g.V().hasLabel("tower").as("a").local(__.out("link").in("link").dedup().as("b").where("a", P.neq("b"))
.coalesce(__.where(__.out("conn").as("a")), __.addE("conn").from("a").to("b"))).iterate()
Test:
// shortest path for each tower to any target
g.V().hasLabel("tower").toList().stream().map(it -> {
g.V(it).coalesce(__.out().has("ref", true),
__.repeat(__.both("conn").where(P.without("t")).store("t").simplePath())
.until(__.out().has("ref", true)))
.hasNext();
} [...]
Shortest Path Sequential
TinkerGraph: 41s
Specialized: 36s
Shortest Path Parallel Stream:
TinkerGraph: 10s
Specialized: 10s
Heap Memory:
TinkerGraph: 2.65 gb
Specialized: 1.68 gb
I put an explicit System.gc() and sleep(5s) between the loading and the analysis to see if there was any difference in memory usage. Nothing notable.
GC Reports: