neo4j / neo4j-javascript-driver

Neo4j Bolt driver for JavaScript

Home Page:https://neo4j.com/docs/javascript-manual/current/

Repository from Github https://github.comneo4j/neo4j-javascript-driverRepository from Github https://github.comneo4j/neo4j-javascript-driver

time consumed in neo4j browser for a query is ~20ms, while using the driver facing a huge increase in time ~370ms.

pawanbana opened this issue · comments

          I am also facing this, using neo4j-driver v5.7.0. the issue is time consumed in neo4j browser for a query is ~20ms, while using the driver facing a huge increase in time ~370ms.

used the console.time and console.timeEnd to still the same time.
environment is nodejs:v18.

     console.time('test1');
      const result = await session.executeRead((tx) => tx.run(query, variables));

      console.timeEnd('test1');

_Originally posted by @pawanbana in https://github.com/neo4j/neo4j-javascript-driver/issues/818#issuecomment-1514727365_
            

@pawanbana, are you using the same method to measure out the performance in browser and node?

I'm having the same issue, as documented in https://github.com/neo4j/neo4j-javascript-driver/issues/818

In browser.neo4j the query takes 3-4ms (ran with profile 2x). with the driver, through node 18, it takes around 150-250ms. Check Edit below.

image image

Some more details:
image

node: v18.14.2
neo4j-driver-lite: v5.13.0
client machine specs: Macbook Air M1 (16gb RAM) with Ventura 13.4.1

Edit:
Actually, we are just comparing and measuring different things. The 3-4ms we see in browser.neo4j is the resultAvailableAfter of the Summary. It tells us how long the query actually takes to have a result.

When checking that same value through the js (or go) driver it still takes around the same time. The query itself only takes the 3-4ms to have a result, but it takes time to a) get to the db; and b) to get the result back over the chosen communication protocol.

Closed since the problem is related to how data is presented in Browser, not in the driver itself (since Browser use the driver).