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:
parent
1c5658f294
commit
1d5245cb13
11
tests/macro_benchmark/groups/bfs_parallel/bfs.run.py
Normal file
11
tests/macro_benchmark/groups/bfs_parallel/bfs.run.py
Normal 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))
|
5
tests/macro_benchmark/groups/bfs_parallel/common.py
Normal file
5
tests/macro_benchmark/groups/bfs_parallel/common.py
Normal file
@ -0,0 +1,5 @@
|
||||
VERTEX_COUNT = 1000
|
||||
SPARSE_FACTOR = 10
|
||||
BFS_ITERS = 50
|
||||
PATH_LENGTH = 5000
|
||||
|
@ -0,0 +1 @@
|
||||
MATCH (n) DETACH DELETE n
|
20
tests/macro_benchmark/groups/bfs_parallel/setup.py
Normal file
20
tests/macro_benchmark/groups/bfs_parallel/setup.py
Normal 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))
|
||||
|
2
tests/macro_benchmark/groups/create_parallel/common.py
Normal file
2
tests/macro_benchmark/groups/create_parallel/common.py
Normal file
@ -0,0 +1,2 @@
|
||||
VERTEX_COUNT = 1000
|
||||
QUERIES_PER_VERTEX = 100
|
7
tests/macro_benchmark/groups/create_parallel/edge.run.py
Normal file
7
tests/macro_benchmark/groups/create_parallel/edge.run.py
Normal 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))
|
@ -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);")
|
@ -1 +1 @@
|
||||
print("CREATE (:A {x : 10});" * 1000000)
|
||||
print("CREATE (:A {x : 10});" * 100000)
|
||||
|
@ -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:
|
||||
|
@ -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")
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user