Slow convert to Java object

33 views
Skip to first unread message

Maxim Milovanov

unread,
Jan 3, 2021, 5:55:47 PM1/3/21
to JanusGraph users

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  

BO XUAN LI

unread,
Jan 3, 2021, 7:50:46 PM1/3/21
to janusgra...@googlegroups.com
--
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 janusgraph-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/janusgraph-users/3fbc61df-9eaa-4508-9e9c-43063c1967f3n%40googlegroups.com.

Reply all
Reply to author
Forward
0 new messages