cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

Why await session.run(query, parameters) so slow in Javascript?

Hello there

As experienced, Neo4j is really really fast to required and produce the results from a query.
If I understand, the concepts of produce and required in JavaScript are exposed by these functions:

result.summary.resultAvailableAfter : Started streaming in Neo4j browser
result.summary.resultConsumedAfter : Completed after in Neo4j browser

Where result is the returning value of await session.run(query, parameters) function.

What I don't understand it's, if resultConsumedAfter is suppose to be the time Neo4j took to request and produce the entire result in ms, why does the function:

const result = await session.run(query, parameters)

Takes multiple seconds to be executed and produce a result object with all the data?

And what can be improve to reduce the time between the Neo4j final result ( resultConsumedAfter ) and the creation of a javascript result variable with all the data?

I have the strong feeling, according to the Neo4j academy courses, this is directly related to the number of results.

If I keep the same amount of data processed in the Neo4j side but I'm adding a RETURN count(*) it's drastically faster for javascript.
If so, why is it so easy for Neo4j to produce all these results in ms but not for javascript?
Producing the actual visual result seems to be slow too in Neo4j Browser when there is a lot of rows and columns, even if getting all the data is really fast according to the stats at the bottom of each query pane

Can we say that the ultimate weakness for Neo4j is returning a lot of results to the client?

Thanks for any lights

0 REPLIES 0