Skip to content

cppa-cursor-browser: Summary cache benchmark validation #115

Description

@clean6378-max-it

Calendar Day

Wednesday, June 24, 2026 (PR 1 of 2)

Planned Effort

5 story points — sprint item #7 (Medium)

Sequences before: Thursday PR 1 (perf benchmark suite #8) — #8 organizes these summary-cache benchmarks under the common conftest and captures baselines for the full suite.

Problem

services/summary_cache.py implements a disk-based cache for workspace project lists, composer-ID-to-workspace mappings, and per-workspace tab summaries, using mtime-based fingerprinting with JSON serialization and SHA-256 digests. The performance claims motivating this cache have no empirical benchmark validation — no measurement of cache hit vs miss latency, fingerprint computation cost, or JSON serialization overhead. Without benchmarks, cache regressions would go undetected.

Goal

One merged PR that adds a pytest-benchmark suite for the summary cache with synthetic fixtures and recorded baselines, alerting on >20% regression, with no change to services/summary_cache.py.

Scope

Touch points

  • tests/benchmarks/test_summary_cache_bench.py (new) — benchmark functions using pytest-benchmark
  • tests/benchmarks/conftest.py — fixtures generating synthetic workspace entries
  • pyproject.toml — add pytest-benchmark to dev dependencies if not present
  • No code change to services/summary_cache.py

Measurements

  • Cache-hit latency
  • Cache-miss latency
  • Fingerprint computation cost at 10 / 50 / 200 workspace entries
  • Round-trip write + read latency

Acceptance Criteria

  • A benchmark suite measures: cache hit latency, cache miss latency, fingerprint computation cost at 10/50/200 workspace entries, round-trip write + read latency
  • Baselines are recorded in a benchmark config file
  • CI runs benchmarks and alerts on >20% regression
  • Existing tests continue to pass
  • Benchmarks use synthetic fixtures (no real Cursor storage dependency)
  • PR approved by at least 1 reviewer

Verification

cd C:\Users\Jasen\CppAliance\cppa-cursor-browser
.\.venv\Scripts\Activate.ps1
pytest tests/benchmarks/test_summary_cache_bench.py --benchmark-only
pytest

Metadata

Metadata

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions