-
Hello! I'm running into some strange results when profiling my traversals; sometimes, when I introduce a Is this just to be expected with these steps/the JanusGraph implementation of TinkerPop? Ultimately, I want a grouped tuple of vertices w/ their properties (hence I wondered if this was related to #2185, but the slowness appears even without I appreciate any help you can give me! 🙂 Example (minimal) traversal: ... profile of the first parts of the traversal, .out(), .both(), .dedup() all look fine/normal
{
"dur": 725.881358,
"counts": {
"traverserCount": 581,
"elementCount": 581
},
"name": "CoalesceStep([[JanusGraphMultiQueryStep, NoOpBarrierStep, JanusGraphVertexStep(IN,[has_interface],vertex)], [IdentityStep]])",
"annotations": {
"percentDur": 85.52726048251452
},
"id": "5.0.0()",
"metrics": [
{
"dur": 3.708015,
"counts": {
"traverserCount": 581,
"elementCount": 581
},
"name": "JanusGraphMultiQueryStep",
"id": "0.1.0(5.0.0())"
},
{
"dur": 1.485557,
"counts": {
"traverserCount": 581,
"elementCount": 581
},
"name": "NoOpBarrierStep",
"id": "2.1.0(5.0.0())"
},
{
"dur": 715.441179,
"counts": {
"traverserCount": 581,
"elementCount": 581
},
"name": "JanusGraphVertexStep(IN,[has_interface],vertex)",
"annotations": {
"condition": "type[has_interface]",
"orders": "[]",
"isFitted": "true",
"isOrdered": "true",
"query": "has_interface:SliceQuery[0x77A1,0x77A2)",
"multi": "true",
"vertices": 1
},
"id": "4.1.0(5.0.0())",
"metrics": [
{
"dur": 0.037271,
"counts": {},
"name": "optimization",
"id": "4.1.0(5.0.0()).optimization_0"
},
{
"dur": 0.812777,
"counts": {
"elementCount": 1
},
"name": "backend-query",
"annotations": {
"query": "has_interface:SliceQuery[0x77A1,0x77A2)"
},
"id": "4.1.0(5.0.0()).backend-query_1"
},
... more of the same
{
"dur": 0.012041,
"counts": {},
"name": "optimization",
"id": "4.1.0(5.0.0()).optimization_1160"
},
{
"dur": 0.942909,
"counts": {
"elementCount": 1
},
"name": "backend-query",
"annotations": {
"query": "has_interface:SliceQuery[0x77A1,0x77A2)"
},
"id": "4.1.0(5.0.0()).backend-query_1161"
}
]
},
{
"dur": 0,
"counts": {},
"name": "IdentityStep",
"id": "0.1.1(5.0.0())"
}
]
} |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Looks like your first part of the query,
returns a lot of vertices. Then, for each vertex, JanusGraph fires a backend query to fetch
So your profiler suggests that What you could do is to split your query into two. In the first query, you run |
Beta Was this translation helpful? Give feedback.
Looks like your first part of the query,
returns a lot of vertices. Then, for each vertex, JanusGraph fires a backend query to fetch
So your profiler suggests that
query.batch
is not working for you. Looks like this is due to the coalesce step. This is a limitation of JanusGraph. It does not optimize every TinkerPop step.What you could do is to split your query into two. In the first query, you run
g.V().has("id", "x").out("has_interface").both("link").dedup()
to fetch a list of vertices. Then, you use multi-threading to fireg.V(v).coalesce(__.in("has_interface"), __.identity())