Skip to content

Commit 80540a6

Browse files
feat: make benchmark Makefile command (#49)
* feat: `make benchmark` Makefile command * Update benchmark.yaml * Update Makefile * Update benchmark.yaml * Update benchmark results [skip ci] --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent 7440fb2 commit 80540a6

File tree

2 files changed

+17
-10
lines changed

2 files changed

+17
-10
lines changed

.github/workflows/benchmark.yaml

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -52,22 +52,13 @@ jobs:
5252
run: rm -r faster_hexbytes
5353

5454
- name: Run Pytest Benchmark & Save Output
55-
run: pytest --benchmark-only --benchmark-json=benchmark.json benchmarks/
55+
run: make benchmark
5656

5757
- name: Upload Pytest Benchmark Results
5858
uses: actions/upload-artifact@v4
5959
with:
6060
name: pytest-benchmark-results
6161
path: benchmark.json
62-
63-
- name: Parse Pytest Benchmark Output
64-
run: python scripts/benchmark/parse_benchmark_output.py benchmark.json pytest_benchmark_results.json
65-
66-
- name: Compare Pytest Benchmark Results
67-
run: python scripts/benchmark/compare_benchmark_results.py pytest_benchmark_results.json pytest_benchmark_diff.json
68-
69-
- name: Generate Markdown Benchmark Results
70-
run: python scripts/benchmark/generate_benchmark_markdown.py
7162

7263
- name: Commit and Push Markdown Benchmark Results
7364
continue-on-error: true

Makefile

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,3 +111,19 @@ check-git:
111111
echo "Error: You must have a remote named 'upstream' that points to 'hexbytes'"; \
112112
exit 1; \
113113
fi
114+
115+
benchmark: run-benchmarks benchmark-results
116+
117+
run-benchmarks:
118+
pytest --benchmark-only --benchmark-json=benchmark.json benchmarks/
119+
120+
benchmark-parse:
121+
python scripts/benchmark/parse_benchmark_output.py benchmark.json pytest_benchmark_results.json
122+
123+
benchmark-compare:
124+
python scripts/benchmark/compare_benchmark_results.py pytest_benchmark_results.json pytest_benchmark_diff.json
125+
126+
benchmark-markdown:
127+
python scripts/benchmark/generate_benchmark_markdown.py
128+
129+
benchmark-results: benchmark-parse benchmark-compare benchmark-markdown

0 commit comments

Comments
 (0)