3

I am querying my Neo4j graph via the php client at graphaware neo4j php client. Now I am experiencing a major performance drop when benchmarking via

$client = Neo4jClient::create()
    ->addConnection('bolt','bolt://neo4j:password@myhost:7687')
    ->build();
$query = "some query";
$time = microtime(true); # system time in microseconds
$result = $client->run($query);
$execms = microtime(true) - $time;
print($execms);

I get query times of about 250 ms, which is a tenfold increase easily when compared to the same query executed in the neo4j browser.

edit: Maybe I should add the the graph is only about 200 nodes large, but the query relies heavily on filtering paths. Also, of course when I run the query a second time, it is about 5 times faster because of caching.

What is the reason for this? I'm imagining maybe

  • bolt protocol not properly enabled for the graphaware client
  • graphaware produces overhead (unpacking results in php objects, ..)
tscherg
  • 1,032
  • 8
  • 22
  • Try run your benchmark more than one time and calc the average... It can be a cache question... – Bruno Peres Jul 07 '17 at 12:15
  • @Bruno Peres please see my edit in the original question – tscherg Jul 07 '17 at 12:18
  • 2
    There is always overhead but cannot be huge. Best maybe would be to post your query. the time that it runs faster on the second time is the query planning caching on server side and has nothing to do with thr driver. Best would be to share your graph and the query – Christophe Willemsen Jul 07 '17 at 12:29
  • @tscherg we are still waiting for more infos, aka your query and an export of your graph – Christophe Willemsen Jul 10 '17 at 07:04
  • Apart from being restricted from making the graph public: I don't really understand how the graph model respectively the query impact this. I will try and produce a dummy to reproduce this! – tscherg Jul 10 '17 at 11:38

0 Answers0