benchmark-action / benchmark-action/github-action-benchmark
Batch publishing
- Dominant language
- TypeScript
- Stars
- 1.3k
- Forks
- 184
- PR merge metrics
- No merged PRs in 30d
Description
Hi,
I have setup a benchmark using this action, on a repository that contains resource files. Each resource file is processed individually, and the result is published to a separate benchmark page. This does work very well, however now we have 200+ resource files that are processed, so the results publishing spawns 200+ jobs, that can't run in parallel because they do commit to the same repository. In the end, the publishing takes ~2h because spawning jobs and re-doing the whole publishing each time is not efficient.
I have seen this discussion: https://github.com/benchmark-action/github-action-benchmark/issues/69 which is solved by aggregating the data files, but in my case I don't want to end up with 1000 graphs on the same page 🙂
Is there a more efficient way to do this ?
Here is the workflow, simplified:
```yml
jobs:
benchmark:
name: Run benchmark
outputs:
benchmark_matrix: ${{ steps.prepare_publish_matrix.outputs.benchmark_matrix }}
steps:
- name: Run benchmark
run: |
mkdir analysis_results
for file in assets/*; do
analyzer "$file" --output "analysis_results/$file.json"
done
- name: Export benchmark results
uses: actions/upload-artifact@v6
with:
name: analysis_results.zip
path: analysis_results
- name: Prepare benchmark publish matrix
id: prepare_publish_matrix
run: |
python3 - <<'PY'
import json
import os
from pathlib import Path
analysis_results_dir = Path("analysis_results")
benchmark_files = sorted(analysis_results_dir.glob("*.json"))
matrix = {
"include": [
{
"benchmark_name": benchmark_file.stem,
"result_file": str(benchmark_file),
}
for benchmark_file in benchmark_files
]
}
output_path = os.environ.get("GITHUB_OUTPUT")
with open(Path(output_path), "a", encoding="utf-8") as output:
output.write("benchmark_matrix<
Contributor guide
Research direction
Start by reviewing the publish-benchmark-results matrix and the Store benchmark result step in the provided workflow, then trace how each action invocation publishes and commits its result. Done means publishing 200+ separate benchmark pages without repeating the full publish-and-commit process for every result, while preserving the separate pages.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- github-actions, typescript
- Domain
- ci-cd
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100