我试图用C#在Neo4j上创建1,000,000(平凡)顶点。 (Community Edition 2.3.2)。性能非常差 - 完成创建节点需要900多秒。我做的事情效率低下吗?为什么需要这么长时间?Neo4j C#顶点创建性能
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; }
}