From 0ff137c2125b79f9128d3c7e4dd3dd54cf46a2ad Mon Sep 17 00:00:00 2001 From: ChrisRackauckas-Claude Date: Sat, 12 Sep 2026 00:32:06 -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 Agent-Model: SWE-2 Max Agent-Session: local session transcript /home/crackauc/.local/share/devin/cli/summaries/history_ccb52064e6514b21.md --- .github/workflows/benchmark.yml | 29 +++++++++++++++++++++++++++++ benchmark/benchmarks.jl | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 61 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 00000000..fcb99013 --- /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: "ModelingToolkit" + job-summary: true diff --git a/benchmark/benchmarks.jl b/benchmark/benchmarks.jl new file mode 100644 index 00000000..5863a8e1 --- /dev/null +++ b/benchmark/benchmarks.jl @@ -0,0 +1,32 @@ +using ModelOrderReduction, BenchmarkTools +using ModelingToolkit + +const SUITE = BenchmarkGroup() + +@independent_variables t +@variables u(t)[1:4] +D = Differential(t) +snapshot = [ + sin(0.3 * i * j) + cos(0.2 * i * (j + 1)) for i in 1:4, j in 1:8 +] + +@mtkcompile sys = System([D(u) ~ -u - u .^ 3], t) +csys = complete(sys) + +# ============================================================================= +# DEIM reduction (symbolic system + snapshot matrix) +# ============================================================================= + +SUITE["deim"] = BenchmarkGroup() + +SUITE["deim"]["deim_2"] = @benchmarkable deim($csys, $snapshot, 2) +SUITE["deim"]["deim_3"] = @benchmarkable deim($csys, $snapshot, 3) + +# ============================================================================= +# POD-Galerkin reduction +# ============================================================================= + +SUITE["pod"] = BenchmarkGroup() + +SUITE["pod"]["pod_2"] = @benchmarkable pod($csys, $snapshot, 2) +SUITE["pod"]["pod_3"] = @benchmarkable pod($csys, $snapshot, 3)