Skip to content

Commit

Permalink
Finalize benchmark workflow
Browse files Browse the repository at this point in the history
Implement benchmark chart generation
  • Loading branch information
shBLOCK committed May 11, 2024
1 parent f9bcd94 commit 3635cc4
Show file tree
Hide file tree
Showing 12 changed files with 235 additions and 134,507 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,7 @@ jobs:

- name: Commit Results
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add benchmark/results/*
git add benchmark/results
git commit -m "Upload benchmark result"
- name: Push
Expand Down
39 changes: 39 additions & 0 deletions .github/workflows/charts.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Charts

on:
workflow_run:
workflows: [Benchmark]
types: [completed]
workflow_dispatch:

jobs:
gen_charts:
name: Gen Benchmark Charts
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: 3.12

- name: Install Dependencies
run: pip install -r benchmark/requirements.txt

- name: Gen Charts
run: python benchmark/gen_charts.py
working-directory: benchmark

- name: Commit Results
run: |
git add benchmark/charts
git commit -m "Upload benchmark charts"
- name: Push
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
[![Tests](https://github.com/shBLOCK/spatium/actions/workflows/tests.yml/badge.svg)](https://github.com/shBLOCK/spatium/actions/workflows/tests.yml)
[![Release](https://github.com/shBLOCK/spatium/actions/workflows/release.yml/badge.svg)](https://github.com/shBLOCK/spatium/actions/workflows/release.yml)
[![Benchmark](https://github.com/shBLOCK/spatium/actions/workflows/benchmark.yml/badge.svg)](https://github.com/shBLOCK/spatium/actions/workflows/benchmark.yml)
[![Charts](https://github.com/shBLOCK/spatium/actions/workflows/charts.yml/badge.svg)](https://github.com/shBLOCK/spatium/actions/workflows/charts.yml)

## ⚙️Main features
- Fast Pure Cython Implementation
Expand All @@ -32,7 +33,7 @@
Please refer to the [wiki](https://github.com/shBLOCK/spatium/wiki) for more details

## 📈Benchmark
[![Benchmark Results](https://github.com/shBLOCK/spatium/raw/master/benchmark/chart.png)](https://github.com/shBLOCK/spatium/tree/master/benchmark/chart.png)
[![Benchmark Results](https://github.com/shBLOCK/spatium/raw/master/benchmark/charts/latest.svg)](https://github.com/shBLOCK/spatium/tree/master/benchmark/charts)

## 🔧Implementation details
- **Codegen!**
Expand Down
300 changes: 0 additions & 300 deletions benchmark/_old_benchmark.py

This file was deleted.

4 changes: 2 additions & 2 deletions benchmark/benchmarking.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@

TIMER = time.perf_counter_ns
BenchmarkFunc = Callable[[int, Callable[[], int]], int]
# AUTO_NUMBER_TARGET_TIME = 0.5e9
AUTO_NUMBER_TARGET_TIME = 0.005e9
AUTO_NUMBER_TARGET_TIME = 0.5e9
# AUTO_NUMBER_TARGET_TIME = 0.005e9

class Subject:
"""
Expand Down
Binary file removed benchmark/chart.png
Binary file not shown.
Loading

0 comments on commit 3635cc4

Please sign in to comment.