Skip to content

Commit 5fdca18

Browse files
ci(benchmarks): run PR benchmarks outside default build
1 parent ad4628d commit 5fdca18

7 files changed

Lines changed: 364 additions & 352 deletions

File tree

.github/workflows/build.yml

Lines changed: 55 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,14 @@ name: Build & SonarQube
33
on:
44
push:
55
branches: [ main, develop ]
6+
paths-ignore:
7+
- '*.md'
8+
- '**/*.md'
69
pull_request:
710
types: [ opened, synchronize, reopened ]
11+
paths-ignore:
12+
- '*.md'
13+
- '**/*.md'
814

915
permissions:
1016
contents: read
@@ -26,11 +32,11 @@ jobs:
2632
CTEST_OUTPUT_ON_FAILURE: "1"
2733

2834
steps:
29-
- name: Install prerequisites (cmake, ninja, coverage tools, git, ca-certs, unzip)
35+
- name: Install prerequisites (cmake, ninja, coverage tools, git, ca-certs, unzip, python3)
3036
run: |
3137
apt-get update
3238
DEBIAN_FRONTEND=noninteractive apt-get install -y \
33-
cmake ninja-build gcovr lcov git ca-certificates unzip jq
39+
cmake ninja-build gcovr lcov git ca-certificates unzip jq python3
3440
update-ca-certificates
3541
3642
- name: Checkout
@@ -97,3 +103,50 @@ jobs:
97103
--define sonar.projectKey=stephenlclarke_ScopeTimer
98104
--define sonar.cfamily.compile-commands=${{ env.BUILD_WRAPPER_OUT_DIR }}/compile_commands.json
99105
--define sonar.coverageReportPaths=build/sonarqube-coverage.xml
106+
107+
benchmarks:
108+
name: GCC 15 • PR Benchmarks
109+
if: github.event_name == 'pull_request'
110+
runs-on: ubuntu-latest
111+
112+
container:
113+
image: gcc:15
114+
115+
steps:
116+
- name: Install prerequisites (cmake, ninja, git, ca-certs, python3)
117+
run: |
118+
apt-get update
119+
DEBIAN_FRONTEND=noninteractive apt-get install -y \
120+
cmake ninja-build git ca-certificates python3
121+
update-ca-certificates
122+
123+
- name: Checkout
124+
uses: actions/checkout@v4
125+
with:
126+
fetch-depth: 0
127+
128+
- name: Configure benchmark driver build
129+
env:
130+
CC: gcc
131+
CXX: g++
132+
run: |
133+
rm -rf build build-bench
134+
cmake -S . -B build -G Ninja \
135+
-DCMAKE_BUILD_TYPE=Release \
136+
-DENABLE_COVERAGE=OFF \
137+
-DENABLE_SONAR=OFF \
138+
-DAUTO_REFRESH_DOCS=OFF \
139+
-DCMAKE_C_COMPILER="${CC}" \
140+
-DCMAKE_CXX_COMPILER="${CXX}"
141+
142+
- name: Run benchmark matrix
143+
run: |
144+
cmake --build build --target demo_benchmark_matrix -j"$(nproc)"
145+
146+
- name: Upload benchmark report
147+
uses: actions/upload-artifact@v4
148+
with:
149+
name: benchmark-report-pr-${{ github.event.pull_request.number }}
150+
path: |
151+
BENCHMARK.md
152+
benchmarks/demo_benchmark_history.json

BENCHMARK.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,17 @@ cmake --build build-review --target demo_benchmark_matrix
1818
matrix, appends `benchmarks/demo_benchmark_history.json`, and refreshes
1919
this file with the latest snapshot.
2020

21+
## Profile meanings
22+
23+
| Profile | Meaning |
24+
| --- | --- |
25+
| Standard timer, default sink | Baseline ScopeTimer cost with the normal synchronous sink and wall-clock timestamps enabled. |
26+
| Standard timer, wall time disabled | Standard timer with `SCOPE_TIMER_WALLTIME=0` so the report shows the cost of dropping `start=` and `end=` timestamp formatting. |
27+
| Standard timer, buffered sink | Single-thread run with the thread-buffered sink enabled to show how much caller-thread write overhead falls when flushes are batched. |
28+
| Standard timer, buffered sink (threaded stress) | Multi-threaded buffered run that stresses contention and cross-thread flush behavior under the standard timer format. |
29+
| Standard timer, async sink | Multi-threaded run with the async sink so flush work moves to the background writer instead of the calling thread. |
30+
| Hot-path timer, async sink | Lowest-overhead profile: hot-path timer format plus the async sink, measured under the threaded stress workload. |
31+
2132
## Current benchmark snapshot
2233

2334
- Recorded at: `2026-04-16T10:45:23+00:00`

0 commit comments

Comments
 (0)