benchmarks #4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: benchmarks | |
on: workflow_dispatch | |
jobs: | |
benchmark-base: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: '3.13' | |
- uses: pyo3/maturin-action@v1 | |
with: | |
command: build | |
args: --release --interpreter python3.13 | |
target: x64 | |
manylinux: auto | |
container: off | |
- run: | | |
export _whl=$(ls target/wheels/rloop-*.whl) | |
pip install $_whl numpy uvloop | |
- name: benchmark | |
working-directory: ./benchmarks | |
run: | | |
python benchmarks.py raw stream proto | |
- name: upload results | |
uses: actions/upload-artifact@v4 | |
with: | |
name: results-base | |
path: benchmarks/results/* | |
benchmark-pyver: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: | | |
3.10 | |
3.11 | |
3.12 | |
3.13 | |
- uses: pyo3/maturin-action@v1 | |
with: | |
command: build | |
args: --release --interpreter python3.10 python3.11 python3.12 python3.13 | |
target: x64 | |
manylinux: auto | |
container: off | |
- name: setup venvs | |
run: | | |
python3.10 -m venv .venv310 | |
python3.11 -m venv .venv311 | |
python3.12 -m venv .venv312 | |
python3.13 -m venv .venv313 | |
.venv310/bin/pip install $(ls target/wheels/rloop-*-cp310-*.whl) numpy uvloop | |
.venv311/bin/pip install $(ls target/wheels/rloop-*-cp311-*.whl) numpy uvloop | |
.venv312/bin/pip install $(ls target/wheels/rloop-*-cp312-*.whl) numpy uvloop | |
.venv313/bin/pip install $(ls target/wheels/rloop-*-cp313-*.whl) numpy uvloop | |
- name: benchmark | |
working-directory: ./benchmarks | |
run: | | |
BENCHMARK_EXC_PREFIX=${{ github.workspace }}/.venv310/bin ${{ github.workspace }}/.venv310/bin/python benchmarks.py raw | |
mv results/data.json results/py310.json | |
BENCHMARK_EXC_PREFIX=${{ github.workspace }}/.venv311/bin ${{ github.workspace }}/.venv311/bin/python benchmarks.py raw | |
mv results/data.json results/py311.json | |
BENCHMARK_EXC_PREFIX=${{ github.workspace }}/.venv312/bin ${{ github.workspace }}/.venv312/bin/python benchmarks.py raw | |
mv results/data.json results/py312.json | |
BENCHMARK_EXC_PREFIX=${{ github.workspace }}/.venv313/bin ${{ github.workspace }}/.venv313/bin/python benchmarks.py raw | |
mv results/data.json results/py313.json | |
- name: upload results | |
uses: actions/upload-artifact@v4 | |
with: | |
name: results-pyver | |
path: benchmarks/results/* | |
results: | |
runs-on: ubuntu-latest | |
needs: [benchmark-base, benchmark-pyver] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: gi0baro/setup-noir@v1 | |
- uses: actions/download-artifact@v4 | |
with: | |
name: results-base | |
path: benchmarks/results | |
- run: | | |
mv benchmarks/results/data.json benchmarks/results/base.json | |
- uses: actions/download-artifact@v4 | |
with: | |
name: results-pyver | |
path: benchmarks/results | |
- name: render | |
working-directory: ./benchmarks | |
run: | | |
noir -c data:results/base.json -v 'benv=GHA Linux x86_64' templates/main.md > README.md | |
noir \ | |
-c data310:results/py310.json \ | |
-c data311:results/py311.json \ | |
-c data312:results/py312.json \ | |
-c data313:results/py313.json \ | |
-v pyvb=310 -v 'benv=GHA Linux x86_64' \ | |
templates/pyver.md > pyver.md | |
- name: open PR | |
uses: peter-evans/create-pull-request@v6 | |
with: | |
branch: benchmarks-update | |
branch-suffix: timestamp | |
title: Update benchmark results | |
body: SSIA | |
commit-message: | | |
Update benchmark results | |
add-paths: | | |
benchmarks/README.md | |
benchmarks/pyver.md |