Skip to content
This repository was archived by the owner on Jun 11, 2026. It is now read-only.

benchmarks

benchmarks #187

Workflow file for this run

name: benchmarks
on:
schedule:
- cron: "0 2 * * *"
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
BENCHMARK_URL: https://pub-2239d82d9a074482b2eb2c886191cb4e.r2.dev/turbo.tar.xz
BENCHMARK_CACHE_KEY: turbo-benchmarks-v1
jobs:
check-changes:
name: Check for changes
runs-on: ubuntu-latest
outputs:
should_run: ${{ steps.check.outputs.should_run }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Check for changes since last run
id: check
run: |
LAST_RUN=$(gh run list --workflow=benchmarks.yml --status=success --limit=1 --json createdAt --jq '.[0].createdAt' 2>/dev/null || echo "")
if [ -z "$LAST_RUN" ]; then
echo "No previous benchmark run found, will run benchmarks"
echo "should_run=true" >> $GITHUB_OUTPUT
exit 0
fi
COMMITS_SINCE=$(git log --since="$LAST_RUN" --oneline origin/main | wc -l)
if [ "$COMMITS_SINCE" -gt 0 ]; then
echo "Found $COMMITS_SINCE commits since last run, will run benchmarks"
echo "should_run=true" >> $GITHUB_OUTPUT
else
echo "No commits since last run, skipping benchmarks"
echo "should_run=false" >> $GITHUB_OUTPUT
fi
env:
GH_TOKEN: ${{ github.token }}
run-turbo-benchmarks:
name: benchmarks-turbo
runs-on: ubuntu-latest
needs: check-changes
if: needs.check-changes.outputs.should_run == 'true' || github.event_name == 'workflow_dispatch'
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Cache benchmark data
id: cache-benchmarks
uses: actions/cache@v3
with:
path: turbo.tar.xz
key: ${{ env.BENCHMARK_CACHE_KEY }}
- name: Download benchmark data
if: steps.cache-benchmarks.outputs.cache-hit != 'true'
run: curl -L -o turbo.tar.xz "$BENCHMARK_URL"
- name: Extract benchmark data
run: |
echo "Extracting benchmark data..."
mkdir -p crates/uplc/benches/turbo/samples
tar -xf turbo.tar.xz -C crates/uplc/benches/turbo/samples
echo "Extraction complete"
ls -la crates/uplc/benches/turbo/samples
- name: Run benchmarks
run: cargo bench --bench turbo -F alloc_profiler