CPU Rise with K-Shorted Path query

  1. data prepare .
    The dataset I use is the movie data showed in dgraph tours.
wget "https://github.com/dgraph-io/tutorial/blob/master/resources/1million.rdf.gz?raw=true" -O 1million.rdf.gz -q

dgraph live -r 1million.rdf.gz

  1. run query:
    I found if both of starring , actor.film, performance.film showed in shortest function as bellow:
 query x{
 path as shortest(from: 0x138b3, to: 0x4, depth:2 ,numpaths: 2) {
  actor.film
  starring
  performance.film
  }
 entity(func: uid(path)) {
      uid
  } 
}

the CPU rise from 27% to 316%
and with no response

It looks like a Multiplicative relation.
Is there any way to make it faster?