Add edge creation and bfs parallel tests

Reviewers: buda, mislav.bradac

Reviewed By: mislav.bradac

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D953
This commit is contained in:
Dominik Gleich 2017-11-07 10:05:59 +01:00
parent 1c5658f294
commit 1d5245cb13
10 changed files with 54 additions and 3 deletions

View File

@ -0,0 +1,11 @@
import random
import common
for i in range(common.BFS_ITERS):
a = int(random.random() * common.VERTEX_COUNT)
b = int(random.random() * common.VERTEX_COUNT)
print("MATCH (from: Node {id: %d}) WITH from "
"MATCH (to: Node {id: %d}) WITH to "
"MATCH path = (from)-[*bfs..%d (e, n | true)]->(to) WITH path "
"LIMIT 10 RETURN 0;"
% (a, b, common.PATH_LENGTH))

View File

@ -0,0 +1,5 @@
VERTEX_COUNT = 1000
SPARSE_FACTOR = 10
BFS_ITERS = 50
PATH_LENGTH = 5000

View File

@ -0,0 +1 @@
MATCH (n) DETACH DELETE n

View File

@ -0,0 +1,20 @@
import random
import common
for i in range(common.VERTEX_COUNT):
print("CREATE (n: Node {id: %d});" % i)
print("CREATE INDEX ON :Node(id);")
# create a tree to be sure there is a path between each two nodes
for i in range(1, common.VERTEX_COUNT):
dad = int(random.random() * i)
print("MATCH (a: Node {id: %d}), (b: Node {id: %d}) CREATE (a)-[:Friend]->(b);" % (dad, i))
print("MATCH (a: Node {id: %d}), (b: Node {id: %d}) CREATE (a)-[:Friend]->(b);" % (i, dad))
# add random edges
for i in range(common.VERTEX_COUNT * common.VERTEX_COUNT // common.SPARSE_FACTOR):
a = int(random.random() * common.VERTEX_COUNT)
b = int(random.random() * common.VERTEX_COUNT)
print("MATCH (a: Node {id: %d}), (b: Node {id: %d}) CREATE (a)-[:Friend]->(b);" % (a, b))

View File

@ -0,0 +1,2 @@
VERTEX_COUNT = 1000
QUERIES_PER_VERTEX = 100

View File

@ -0,0 +1,7 @@
import random
import common
for i in range(common.VERTEX_COUNT * common.QUERIES_PER_VERTEX):
a = int(random.random() * common.VERTEX_COUNT)
b = int(random.random() * common.VERTEX_COUNT)
print("MATCH (a: Node {id: %d}), (b: Node {id: %d}) CREATE (a)-[:Friend]->(b);" % (a, b))

View File

@ -0,0 +1,5 @@
import common
for i in range(common.VERTEX_COUNT):
print("CREATE (n: Node {id: %d});" % i)
print("CREATE INDEX ON :Node(id);")

View File

@ -1 +1 @@
print("CREATE (:A {x : 10});" * 1000000)
print("CREATE (:A {x : 10});" * 100000)

View File

@ -181,7 +181,7 @@ class QueryParallelSuite(_QuerySuite):
NeoParallelRunner}
def groups(self):
return ["aggregation_parallel", "create_parallel"]
return ["aggregation_parallel", "create_parallel", "bfs_parallel"]
class _QueryRunner:

View File

@ -196,7 +196,7 @@ MACRO_BENCHMARK_ARGS = (
"--no-strict --database-cpu-ids 1 --client-cpu-ids 2")
MACRO_PARALLEL_BENCHMARK_ARGS = (
"QueryParallelSuite MemgraphRunner --groups aggregation_parallel "
"--database-cpu-ids 1 2 3 4 5 6 7 8 9 "
"create_parallel bfs_parallel --database-cpu-ids 1 2 3 4 5 6 7 8 9 "
"--client-cpu-ids 10 11 12 13 14 15 16 17 18 19 "
"--num-database-workers 9 --num-clients-workers 30 --no-strict")