Problem
Is there something I'm missing on how to run with g.addV()
?
Is there some way to speed up g.addV()
?
If I'm asking this wrong or something else is missing, please let me know so I can correct myself.
I'm testing GraphDBs (Graph-Databases) and evaluation requirements and metrics are being inspected upon:
- Standard Format: "Apples-2-Apples" comparison
- Running them all with Gremlin-Server's
g.addV()
would be a stronger comparison of databases rather than difference in coding
- Running them all with Gremlin-Server's
- If implementation is faster, then I should be using that instead
- Like OrientDB which is about 40-50% faster handling the data
addVertex()
has been between 15-30 minutesaddV()
has been between 25-40 minutes
- Like OrientDB which is about 40-50% faster handling the data
org.apache.tinkerpop.gremlin.orientdb.OrientGraph
OrientGraph orientGraph = OrientGraph.open(configuration);
// for-loop
Vertex vertex = orientGraph.addVertex(_labels);
org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource
Transaction tx = g.tx();
tx.open();
GraphTraversalSource g = orientGraph.traversal();
// for-loop
Vertex vertex = g.addV(_labels).next();
tx.commit();
After all, Tinkerpop3-Gremlin's GraphTraversalSource
and its addV()
uses Transaction tx
just like OrientDB's OrientGraph
and its addVertex()
.
public class GraphTraversalSource implements TraversalSource {
// ...
public GraphTraversal<Vertex, Vertex> addV(final String vertexLabel) {
if (null == vertexLabel) {
throw new IllegalArgumentException("vertexLabel cannot be null");
} else {
GraphTraversalSource clone = this.clone();
clone.bytecode.addStep("addV", new Object[]{vertexLabel});
GraphTraversal.Admin<Vertex, Vertex> traversal = new DefaultGraphTraversal(clone);
return traversal.addStep(new AddVertexStartStep(traversal, vertexLabel));
}
}
// ...
public Transaction tx() {
if (null == this.connection) {
return this.graph.tx();
} else {
Transaction tx = this.connection.tx();
return tx == Transaction.NO_OP && this.connection instanceof Transaction ? (Transaction)this.connection : tx;
}
}
// ...
}