test(perf): opt-in gates for the 500k-photo library and the 100k-frame rebuild

Category perf, skipped unless TITANO_PERF=1. A synthetic library of 2,000
sequences and 500,000 frames (SQLite, and PostgreSQL when TITANO_TEST_PG is
set) must open the Library in under 1 s cold and answer every filter, search,
sort and next page in under 200 ms; a 100,000-frame archive adopted from real
files must rebuild from its sidecars, with and without the index snapshot,
into the identical index within the scaled 2-minute budget. perf.yml runs
them weekly and on demand against PostgreSQL 17 and writes the timings to the
job summary.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
This commit is contained in:
Claude committed 2026-10-02 22:35:30 +00:00
1 parent 2650aa31fb
commit 7170943c68
5 files changed
+385

No files matched your search

+73
View File
@@ -0,0 +1,73 @@
name: Performance gates
# BRIEF §1.1 and the Phase 2/3 gates on a synthetic 500,000-photo library (SQLite and PostgreSQL 17) and a
# 100,000-frame archive rebuild from sidecars. Too slow for every push: weekly and on demand.
on:
schedule:
- cron: "41 3 * * 1"
workflow_dispatch:
permissions:
contents: read
concurrency:
group: perf-${{ github.ref }}
cancel-in-progress: true
env:
DOTNET_NOLOGO: "1"
DOTNET_CLI_TELEMETRY_OPTOUT: "1"
jobs:
perf:
name: Library and rebuild gates
runs-on: ubuntu-latest
timeout-minutes: 90
services:
postgres:
image: postgres:17
env:
POSTGRES_USER: titano
POSTGRES_PASSWORD: titano-ci
POSTGRES_DB: titano_perf
ports:
- 5432:5432
options: >-
--health-cmd "pg_isready -U titano -d titano_perf"
--health-interval 5s --health-timeout 5s --health-retries 20
env:
TITANO_PERF: "1"
TITANO_TEST_PG: Host=127.0.0.1;Port=5432;Database=titano_perf;Username=titano;Password=titano-ci;SslMode=disable
steps:
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v4
with:
global-json-file: global.json
- name: Build
run: dotnet build tests/Titano.Data.Tests -c Release
- name: Perf tests (SQLite, PostgreSQL 17)
run: |
set -o pipefail
dotnet run --project tests/Titano.Data.Tests -c Release --no-build -- --filter category:perf --verbose --junit out/junit/perf.xml | tee out-perf.log
- name: Timings
if: always()
run: |
{
echo "## Performance gates"
echo '```'
grep -h "perf:" out-perf.log 2>/dev/null | sed 's/^ *//' || echo "no timings recorded"
echo '```'
} >> "$GITHUB_STEP_SUMMARY"
- name: Upload results
if: always()
uses: actions/upload-artifact@v4
with:
name: perf-results
path: |
out/junit/
out-perf.log
if-no-files-found: ignore