diff --git a/tests/macro_benchmark/groups/bfs_parallel/bfs.run.py b/tests/macro_benchmark/groups/bfs_parallel/bfs.run.py new file mode 100644 index 000000000..145044186 --- /dev/null +++ b/tests/macro_benchmark/groups/bfs_parallel/bfs.run.py @@ -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)) diff --git a/tests/macro_benchmark/groups/bfs_parallel/common.py b/tests/macro_benchmark/groups/bfs_parallel/common.py new file mode 100644 index 000000000..eab1462a3 --- /dev/null +++ b/tests/macro_benchmark/groups/bfs_parallel/common.py @@ -0,0 +1,5 @@ +VERTEX_COUNT = 1000 +SPARSE_FACTOR = 10 +BFS_ITERS = 50 +PATH_LENGTH = 5000 + diff --git a/tests/macro_benchmark/groups/bfs_parallel/iterteardown.cypher b/tests/macro_benchmark/groups/bfs_parallel/iterteardown.cypher new file mode 100644 index 000000000..37d4c9dd4 --- /dev/null +++ b/tests/macro_benchmark/groups/bfs_parallel/iterteardown.cypher @@ -0,0 +1 @@ +MATCH (n) DETACH DELETE n diff --git a/tests/macro_benchmark/groups/bfs_parallel/setup.py b/tests/macro_benchmark/groups/bfs_parallel/setup.py new file mode 100644 index 000000000..2a3a9b984 --- /dev/null +++ b/tests/macro_benchmark/groups/bfs_parallel/setup.py @@ -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)) + diff --git a/tests/macro_benchmark/groups/create_parallel/common.py b/tests/macro_benchmark/groups/create_parallel/common.py new file mode 100644 index 000000000..7bee46ab8 --- /dev/null +++ b/tests/macro_benchmark/groups/create_parallel/common.py @@ -0,0 +1,2 @@ +VERTEX_COUNT = 1000 +QUERIES_PER_VERTEX = 100 diff --git a/tests/macro_benchmark/groups/create_parallel/edge.run.py b/tests/macro_benchmark/groups/create_parallel/edge.run.py new file mode 100644 index 000000000..17383cd6a --- /dev/null +++ b/tests/macro_benchmark/groups/create_parallel/edge.run.py @@ -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)) diff --git a/tests/macro_benchmark/groups/create_parallel/edge.setup.py b/tests/macro_benchmark/groups/create_parallel/edge.setup.py new file mode 100644 index 000000000..67db52b53 --- /dev/null +++ b/tests/macro_benchmark/groups/create_parallel/edge.setup.py @@ -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);") diff --git a/tests/macro_benchmark/groups/create_parallel/vertex.run.py b/tests/macro_benchmark/groups/create_parallel/vertex.run.py index 10258cc05..7a81bb4e8 100644 --- a/tests/macro_benchmark/groups/create_parallel/vertex.run.py +++ b/tests/macro_benchmark/groups/create_parallel/vertex.run.py @@ -1 +1 @@ -print("CREATE (:A {x : 10});" * 1000000) +print("CREATE (:A {x : 10});" * 100000) diff --git a/tests/macro_benchmark/query_suite.py b/tests/macro_benchmark/query_suite.py index c3aae210a..71a14f0f6 100644 --- a/tests/macro_benchmark/query_suite.py +++ b/tests/macro_benchmark/query_suite.py @@ -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: diff --git a/tools/apollo/generate b/tools/apollo/generate index ea2897e0e..d45fe58fb 100755 --- a/tools/apollo/generate +++ b/tools/apollo/generate @@ -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")