Hi Michael,
I dug further and found the backend call is taking approximately 12
seconds! The code snippets are as follow:
public SomeGraph getGraph(){
...
Traverser traverser = traversalDescription.traverse(startNode);
Integer count = 0;
for(Node thisNode:traverser.nodes){//this for loop took 12 seconds to
iterate 238 nodes.
count++;
}
System.out.println("Count is: " + String.ValueOf(count));
---------------
Count is 238
On Wednesday, February 26, 2014 4:33:09 PM UTC+8, Michael Hunger wrote:
>
> David how long does the backend call take? And please share the code of
> the traversal request with us.
>
> If the info-viz rendering is taking soo long for just a few nodes, perhaps
> it's better to look for a different rendering toolkit?
>
> Michael
>
> Am 26.02.2014 um 08:15 schrieb David Yang <[email protected] <javascript:>
> >:
>
> Hi,
>
> I have a JSP frontend which makes 1 REST API call to backend to retrieve a
> graph with nodes and edges. These will be drawn on the frontend via Java
> InfoVis Toolkit.
> The problem comes when this REST API call to backend, the java code there
> does a path.traverse(...) which should return 200 nodes and 199 edges. The
> result is wrapped in json and its returned by the API call. The Java
> InfoVis Toolkit starts rendering based on the json and its taking like 10
> over seconds.
>
> My question is is there a sample code regarding path.traverse(...) which
> it can traverse the graph progressively (by multiple sets of API calls) so
> that the immediate first set of result can be returned to frontend for
> rendering?
>
> Example:
> 1st API call : path.traverse(... node #1 to node #50), return 50 nodes and
> 49 edges. Frontend starts rendering.
> 2nd API call invoked by frontend: path.traverse (... node #51 to node
> #100), continue and return 50 nodes and 49 edges. Frontend continues to
> render these nodes on top of those already rendered in 1st API call.
> 3rd API call invoked by frontend: path.traverse (... node #101 to node
> #150), continue and return 50 nodes and 49 edges. Frontend continues to
> render these nodes.
> and so on.
>
> I am using neo4j community 1.9.1. windows, jdk 1.7
>
> Thanks in advance
> David
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Neo4j" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected] <javascript:>.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>
--
You received this message because you are subscribed to the Google Groups
"Neo4j" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.