From 46951f4fee2a4e96147fa7e5fe9f50c6db3aa672 Mon Sep 17 00:00:00 2001 From: ChrisRackauckas-Claude Date: Fri, 11 Sep 2026 12:31:12 -0400 Subject: [PATCH] Add AirspeedVelocity benchmarking CI Adds a benchmark workflow (Julia 1 and lts) and a benchmark/benchmarks.jl suite covering representative workloads so PRs check for performance regressions. Co-Authored-By: Chris Rackauckas Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com> Agent-Harness: devin 3000.10.21 (611c1cba) Agent-Model: SWE-2 High Agent-Session: local session transcript /home/crackauc/sandbox/tmp_20260911_112052_59120/history_6a789c0b69c64ca3.md --- .github/workflows/benchmark.yml | 29 +++++++++++++++++++++++ benchmark/benchmarks.jl | 41 +++++++++++++++++++++++++++++++++ 2 files changed, 70 insertions(+) create mode 100644 .github/workflows/benchmark.yml create mode 100644 benchmark/benchmarks.jl diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml new file mode 100644 index 0000000..0695beb --- /dev/null +++ b/.github/workflows/benchmark.yml @@ -0,0 +1,29 @@ +name: Benchmark this PR + +on: + pull_request: + branches: [main] + paths-ignore: ['docs/**'] + +permissions: + pull-requests: write + contents: read + +jobs: + benchmark: + runs-on: ubuntu-latest + timeout-minutes: 30 + strategy: + fail-fast: false + matrix: + version: ["1", "lts"] + env: + # Force consistent Julia depot path for self-hosted runners + JULIA_DEPOT_PATH: ~/.julia + steps: + - uses: MilesCranmer/AirspeedVelocity.jl@action-v1 + with: + julia-version: ${{ matrix.version }} + script: "benchmark/benchmarks.jl" + extra-pkgs: "StableRNGs" + job-summary: true diff --git a/benchmark/benchmarks.jl b/benchmark/benchmarks.jl new file mode 100644 index 0000000..26fba53 --- /dev/null +++ b/benchmark/benchmarks.jl @@ -0,0 +1,41 @@ +using FastAlmostBandedMatrices, BenchmarkTools +using StableRNGs, LinearAlgebra + +const SUITE = BenchmarkGroup() +const rng = StableRNG(123) + +# AlmostBandedMatrix = banded part + full "fill" rows at the bottom +n = 300 +m = 4 +banded_part = BandedMatrix(rand(rng, n, n), (3, 2)) +fill_part = rand(rng, m, n) +A = AlmostBandedMatrix(banded_part, fill_part) +x = rand(rng, n) +y = zeros(n) + +A_dense = Matrix(A) + +# ============================================================================= +# Construction +# ============================================================================= + +SUITE["construct"] = BenchmarkGroup() + +SUITE["construct"]["almost_banded"] = @benchmarkable AlmostBandedMatrix( + $banded_part, $fill_part +) +SUITE["construct"]["banded"] = @benchmarkable BandedMatrix( + $(rand(rng, n, n)), (3, 2) +) + +# ============================================================================= +# Operations +# ============================================================================= + +SUITE["ops"] = BenchmarkGroup() + +SUITE["ops"]["matvec"] = @benchmarkable $A * $x +SUITE["ops"]["mul!"] = @benchmarkable mul!($y, $A, $x) +SUITE["ops"]["to_dense"] = @benchmarkable Matrix($A) +SUITE["ops"]["lu"] = @benchmarkable lu($A) +SUITE["ops"]["ldiv"] = @benchmarkable $A_dense \ $x