Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Benchmarks

on:
push:
branches: [main]
schedule:
- cron: "0 4 * * 1"
workflow_dispatch:

concurrency:
group: benchmark-results
cancel-in-progress: false

jobs:
benchmark:
runs-on: ubuntu-latest
permissions:
contents: write
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@d48d326b4ca9ba73ca0cd0d59f108f9e02a381c7
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
8 changes: 0 additions & 8 deletions .github/workflows/ci-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Loading