Add supernode performance workload (#1171)
This commit is contained in:
parent
28dbcd1545
commit
b952139973
12
.github/workflows/daily_benchmark.yaml
vendored
12
.github/workflows/daily_benchmark.yaml
vendored
@ -67,7 +67,9 @@ jobs:
|
|||||||
- name: Run mgbench
|
- name: Run mgbench
|
||||||
run: |
|
run: |
|
||||||
cd tests/mgbench
|
cd tests/mgbench
|
||||||
./benchmark.py vendor-native --num-workers-for-benchmark 12 --export-results benchmark_result.json pokec/medium/*/*
|
./benchmark.py vendor-native --num-workers-for-benchmark 12 --export-results benchmark_pokec.json pokec/medium/*/*
|
||||||
|
|
||||||
|
./benchmark.py vendor-native --num-workers-for-benchmark 1 --export-results benchmark_supernode.json supernode
|
||||||
|
|
||||||
- name: Upload mgbench results
|
- name: Upload mgbench results
|
||||||
run: |
|
run: |
|
||||||
@ -76,7 +78,13 @@ jobs:
|
|||||||
source ve3/bin/activate
|
source ve3/bin/activate
|
||||||
pip install -r requirements.txt
|
pip install -r requirements.txt
|
||||||
./main.py --benchmark-name "mgbench" \
|
./main.py --benchmark-name "mgbench" \
|
||||||
--benchmark-results-path "../../tests/mgbench/benchmark_result.json" \
|
--benchmark-results-path "../../tests/mgbench/benchmark_pokec.json" \
|
||||||
|
--github-run-id "${{ github.run_id }}" \
|
||||||
|
--github-run-number "${{ github.run_number }}" \
|
||||||
|
--head-branch-name "${{ env.BRANCH_NAME }}"
|
||||||
|
|
||||||
|
./main.py --benchmark-name "supernode" \
|
||||||
|
--benchmark-results-path "../../tests/mgbench/benchmark_supernode.json" \
|
||||||
--github-run-id "${{ github.run_id }}" \
|
--github-run-id "${{ github.run_id }}" \
|
||||||
--github-run-number "${{ github.run_number }}" \
|
--github-run-number "${{ github.run_number }}" \
|
||||||
--head-branch-name "${{ env.BRANCH_NAME }}"
|
--head-branch-name "${{ env.BRANCH_NAME }}"
|
||||||
|
43
tests/mgbench/workloads/supernode.py
Normal file
43
tests/mgbench/workloads/supernode.py
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
# Copyright 2023 Memgraph Ltd.
|
||||||
|
#
|
||||||
|
# Use of this software is governed by the Business Source License
|
||||||
|
# included in the file licenses/BSL.txt; by using this file, you agree to be bound by the terms of the Business Source
|
||||||
|
# License, and you may not use this file except in compliance with the Business Source License.
|
||||||
|
#
|
||||||
|
# As of the Change Date specified in that file, in accordance with
|
||||||
|
# the Business Source License, use of this software will be governed
|
||||||
|
# by the Apache License, Version 2.0, included in the file
|
||||||
|
# licenses/APL.txt.
|
||||||
|
|
||||||
|
from workloads.base import Workload
|
||||||
|
|
||||||
|
|
||||||
|
class Supernode(Workload):
|
||||||
|
NAME = "supernode"
|
||||||
|
CARDINALITY = 50000
|
||||||
|
|
||||||
|
def indexes_generator(self):
|
||||||
|
return [
|
||||||
|
("CREATE INDEX ON :Supernode;", {}),
|
||||||
|
("CREATE INDEX ON :Supernode(id);", {}),
|
||||||
|
("CREATE INDEX ON :Node;", {}),
|
||||||
|
("CREATE INDEX ON :Node(id);", {}),
|
||||||
|
]
|
||||||
|
|
||||||
|
def dataset_generator(self):
|
||||||
|
queries = []
|
||||||
|
queries.append(("CREATE (:Supernode {id: $id});", {"id": 1}))
|
||||||
|
for i in range(0, Supernode.CARDINALITY):
|
||||||
|
queries.append(("CREATE (:Node {id: $id});", {"id": i}))
|
||||||
|
queries.append(("MATCH (s:Supernode), (n:Node) CREATE (s)<-[:EDGE]-(n)", {}))
|
||||||
|
|
||||||
|
return queries
|
||||||
|
|
||||||
|
def benchmark__test__merge_supernode_edges(self):
|
||||||
|
return ("MATCH (s:Supernode), (n:Node) MERGE (s)<-[:EDGE]-(n);", {})
|
||||||
|
|
||||||
|
def benchmark__test__merge_supernode_edges_other_way(self):
|
||||||
|
return ("MATCH (s:Supernode), (n:Node) MERGE (n)-[:EDGE]->(s);", {})
|
||||||
|
|
||||||
|
def benchmark__test__unwind_supernode_with_writes(self):
|
||||||
|
return (f"UNWIND range(1, {Supernode.CARDINALITY}) AS x MATCH (s:Supernode) SET s.prop = x", {})
|
Loading…
Reference in New Issue
Block a user