Re: Slow convert to Java object


BO XUAN LI <libo...@...>
 

On Dec 31, 2020, at 7:29 PM, Maxim Milovanov <milov...@...> wrote:

Hi!

I am trying write select-query and my perfomance is very slow when I call method toList().
How I can improve this perfomace ?


My example:

        long start;

        long end;

        try (GraphTraversalSource g = graph.traversal()) {

            start = System.currentTimeMillis();

            GraphTraversal<Vertex, Vertex> list2 = g.V().hasLabel("Entity");


            end = System.currentTimeMillis();


            System.out.printf("getGremlinTime: %d ms\n", (end - start));


            start = end;

            List<Vertex> res2 = list2.toList();


            end = System.currentTimeMillis();

            System.out.printf("toList: %d ms\n gremlin count: %d\n", (end - start), res2.size());

        }


Debug log:

getGremlinTime: 13 ms
2020-12-31 14:19:01.336  WARN 14144 --- [           main] o.j.g.transaction.StandardJanusGraphTx   : Query requires iterating over all vertices [(~label = Entity)]. For better performance, use indexes
toList: 12025 ms
 gremlin count: 105  

--
You received this message because you are subscribed to the Google Groups "JanusGraph users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to janusgra...@....
To view this discussion on the web visit https://groups.google.com/d/msgid/janusgraph-users/3fbc61df-9eaa-4508-9e9c-43063c1967f3n%40googlegroups.com.

Join janusgraph-users@lists.lfaidata.foundation to automatically receive all group messages.