Closed flip111 closed 11 years ago
Should there not be a request header of X-Stream: true
instead? Looking at the docs stream=true
is added to the response not the request
Hmm yes curious case. The blog post is using curl to connect to the database and the curl is like this:
curl -i -o streamed.txt -XPOST -d'{ "query" : "start n=node(*) match p=n-[r:TYPE]->m return n,r,m,p" }' -H "accept:application/json;stream=true" -H content-type:application/json http://localhost:7474/db/data/cypher
Appreciate any input on this matter !
I'd like to see some benchmarks pulling down thousands of objects. I'm not sure this will actually improve performance much, since the client still needs to receive the entire JSON document before it can be parsed, which is where the performance hit is. The only way to get any real improvement is to parse the partial JSON response as it streams in. I know the py2neo project does this, if anyone wants to look into how that works.
This should be combined with #96. Keep the "stream=true" on the Accept header for older server versions, and also add the "X-Stream: true header" for the newer servers.
Should also be done for Transport/Stream.php.
@alexbilbie, please add the "stream=true" in your pull request in the Stream transport. @flip111, please add the "X-Stream: true" header to this pull request for the Curl transport.
I will close this because the discussion in https://github.com/jadell/neo4jphp/pull/96 and the changes in https://github.com/jadell/neo4jphp/pull/99 look much better
According to this blog http://blog.neo4j.org/2012/04/streaming-rest-api-interview-with.html the performance increases when http streaming is enabled. I tested a query and everything still seems to be functional. However i don't have a large enough graph to really test performance with this at the moment.
Documentation: http://docs.neo4j.org/chunked/snapshot/rest-api-streaming.html