有人可以提供一些关于如何在neo4j中插入两个节点并估计时间然后插入4个节点并估计时间然后是8,16,32等等直到1024个节点。
答案 0 :(得分:1)
这是PHP中的一个简单示例,在任何编程语言中都有相同的想法:
$query = 'UNWIND range(1,{max}) as i CREATE (n:Node {v:i})';
$max = 2;
do {
$s = microtime(true);
$client->run($query, ['max' => $max]);
echo sprintf('query took %f ms', microtime(true) - $s) . PHP_EOL;
$max *= 2;
} while($max <= 1024);
将返回:
query took 0.020220 ms
query took 0.009002 ms
query took 0.011413 ms
query took 0.014552 ms
query took 0.012378 ms
query took 0.021977 ms
query took 0.032880 ms
query took 0.019982 ms
query took 0.045166 ms
query took 0.046428 ms