From bd95c079e76cb4ee9255bdccfd6a6675723f4e15 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 6 Oct 2026 04:22:06 +0000 Subject: [PATCH 1/2] Publish benchmark history and dashboard Co-authored-by: embtom <16663460+embtom@users.noreply.github.com> --- .github/workflows/benchmark.yml | 44 +++++++++++++++++++++++++++++++++ .github/workflows/ci-build.yml | 8 ------ README.md | 7 ++++++ 3 files changed, 51 insertions(+), 8 deletions(-) create mode 100644 .github/workflows/benchmark.yml diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml new file mode 100644 index 0000000..ca85d21 --- /dev/null +++ b/.github/workflows/benchmark.yml @@ -0,0 +1,44 @@ +name: Benchmarks + +on: + push: + branches: [main] + schedule: + - cron: "0 4 * * 1" + workflow_dispatch: + +permissions: + contents: write + +concurrency: + group: benchmark-results + cancel-in-progress: false + +jobs: + benchmark: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v7 + + - name: Install build dependencies + run: ./scripts/build-dependencies.sh + + - name: Build and run benchmarks + working-directory: ctprintf + run: | + cmake --workflow --fresh --preset benchmark-workflow + ./build/benchmark/benchmarks/ctprintf_benchmarks \ + --benchmark_min_time=1s \ + --benchmark_repetitions=3 \ + --benchmark_out=./build/benchmark/benchmarks/benchmark_results.json \ + --benchmark_out_format=json + + - name: Publish benchmark results + uses: benchmark-action/github-action-benchmark@v1.20.4 + with: + tool: googlecpp + output-file-path: ctprintf/build/benchmark/benchmarks/benchmark_results.json + github-token: ${{ secrets.GITHUB_TOKEN }} + gh-pages-branch: gh-pages + benchmark-data-dir-path: dev/bench + auto-push: true diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index f9f6c61..77d6d1a 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -35,14 +35,6 @@ jobs: working-directory: ctprintf run: cmake --workflow --preset release-workflow - - name: Run performance benchmarks - working-directory: ctprintf - run: | - cmake --workflow --fresh --preset benchmark-workflow - ./build/benchmark/benchmarks/ctprintf_benchmarks \ - --benchmark_min_time=1s \ - --benchmark_repetitions=3 - - name: Build Debian package run: ./scripts/build-package.sh diff --git a/README.md b/README.md index 30142bf..01882f8 100644 --- a/README.md +++ b/README.md @@ -159,6 +159,13 @@ cmake --workflow --preset benchmark-workflow The benchmark target is separate from CTest because execution time varies between machines and system load. +## Benchmark results + +The [benchmark dashboard](https://embtom.github.io/ctprintf/) tracks performance +over time. Results are updated on pushes to `main` and weekly. To publish the +dashboard, enable GitHub Pages for the repository with the `gh-pages` branch as +the source. + ## Creating a package CPack creates a gzip-compressed tarball containing the installable headers, From fe02cd5f0590b90a26df127f1848c11e526dec31 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 6 Oct 2026 04:22:46 +0000 Subject: [PATCH 2/2] Harden benchmark workflow permissions Co-authored-by: embtom <16663460+embtom@users.noreply.github.com> --- .github/workflows/benchmark.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index ca85d21..d58818e 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -7,9 +7,6 @@ on: - cron: "0 4 * * 1" workflow_dispatch: -permissions: - contents: write - concurrency: group: benchmark-results cancel-in-progress: false @@ -17,6 +14,8 @@ concurrency: jobs: benchmark: runs-on: ubuntu-latest + permissions: + contents: write steps: - uses: actions/checkout@v7 @@ -34,7 +33,7 @@ jobs: --benchmark_out_format=json - name: Publish benchmark results - uses: benchmark-action/github-action-benchmark@v1.20.4 + uses: benchmark-action/github-action-benchmark@d48d326b4ca9ba73ca0cd0d59f108f9e02a381c7 with: tool: googlecpp output-file-path: ctprintf/build/benchmark/benchmarks/benchmark_results.json