I am trying to understand the performance of Cypher Vertex creation when
creating items with a C# client.
I am using Neo4j Community Edition 2.3.2.
I am creating 1,000,000 (useless) vertices in a Neo4j instance, and
measuring how long it takes.
Here is my code:
var client = new GraphClient(new
Uri("http://localhost:7474/db/data"), "neo4j", "password");
client.Connect();
DateTime t = DateTime.Now;
Debug.WriteLine(t);
for (int j = 0; j < 100; j++ ) {
using (var scope = new TransactionScope(
TransactionScopeOption.Required,
new TransactionOptions {IsolationLevel =
IsolationLevel.ReadCommitted}
))
{
for (int i = 0; i < 10000; i++) {
var index = new Category { label = i.ToString() };
client.Cypher
.Create("(class:testItem {index})")
.WithParam("index", index)
.ExecuteWithoutResults();
}
scope.Complete();
}
Debug.WriteLine(j);
}
Debug.WriteLine(DateTime.Now.Subtract(t).Seconds);
.....
public class Category
{
public String label { get; set; }
}
This takes 923 s, which seems far too long to me. Am I doing something
horrifically inefficient in this code?
Thanks
--
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/d/optout.