Add supernode performance workload (#1171)

This commit is contained in:
Josipmrden 2023-08-30 15:19:52 +02:00 committed by GitHub
parent 28dbcd1545
commit b952139973
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 53 additions and 2 deletions

View File

@ -67,7 +67,9 @@ jobs:
- name: Run mgbench
run: |
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
run: |
@ -76,7 +78,13 @@ jobs:
source ve3/bin/activate
pip install -r requirements.txt
./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-number "${{ github.run_number }}" \
--head-branch-name "${{ env.BRANCH_NAME }}"

View 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", {})