Benchmark performance review

From casedash/CaseDash · View interactive version

Benchmark performance review is an AI agent skill from the GitHub repository casedash/CaseDash. Use only when explicitly invoked: review CaseDash benchmark performance.

How to use this skill

Skill file

Benchmark Performance Review

Overview

Use this skill to verify that CaseDash performance still matches the maintained machine-specific benchmark ranges, then fix repeatable regressions with measured, narrowly scoped changes.

Required Context

  1. Read AGENTS.md.
  2. Read docs/profile_benchmark.md before forming conclusions. Treat it as the source of truth for benchmark commands, shared hotspot models, kept optimizations, rejected experiments, and practical guidance.
  3. Read the matching docs/performance/<machine>.md file for the current machine's benchmark ranges, bottlenecks, and research directions.
  4. Read docs/build.md for build and validation entrypoints.
  5. Read relevant architecture docs before changing subsystem boundaries:
  1. Read owning behavior docs before changing user-visible behavior, diagnostics output, provider behavior, layout-edit behavior, or layout-guide-sheet behavior.

Baseline Review

  1. Inspect git status --short; ignore unrelated dirty work and do not revert changes made by others.
  2. Build a fresh benchmark executable:
.\build.cmd /benchmarks
  1. Run every maintained direct benchmark listed in the Benchmark Workflow section of docs/profile_benchmark.md sequentially from the fresh build. Do not duplicate the command list here; docs/profile_benchmark.md is the owning source of truth.
  1. Compare direct-run timing lines with the current known range in the matching docs/performance/<machine>.md file. Compare like with like: primary loop metrics, named submetrics, same benchmark name, same iteration count, and same warmup count.
  2. Treat a single noisy run as inconclusive. When a metric looks slow, rerun the same direct benchmark at least twice and compare the median or the stable range.
  3. Treat a regression as actionable when the primary loop metric or an important submetric is repeatably worse than the documented current range beyond normal noise, especially when a hot UI-path metric moves by roughly 10% or more, a guide-sheet metric moves by several milliseconds, or the regression changes the known hotspot shape.
  4. Use direct build\CaseDashBenchmarks.exe runs as the repeatable baseline. Use profile_benchmark.cmd timings only as profiler-instrumented confirmation, not as the baseline comparison.

Regression Investigation

  1. Isolate the changed benchmark and the first metric that moved. Prefer the smallest repeatable direct benchmark loop while investigating.
  2. Review the matching machine file under docs/performance/ and the shared sections in docs/profile_benchmark.md:
  1. Do not retry experiments that the log rejects unless surrounding code changed enough to make the old result stale. Record why the retry is justified.
  2. Capture a benchmark-focused profile when direct runs show a material regression or when hotspot attribution is needed. Use the matching profile_benchmark.cmd command documented in the Benchmark Workflow section of docs/profile_benchmark.md.
  1. For repeated unattended profiling, start the elevated daemon once with .\profile_benchmark.cmd /daemon-start, then issue ordinary profile_benchmark.cmd <benchmark> ... requests.
  2. Prefer fixes that reduce real hot-path work, preserve the documented benchmark harness semantics, and keep benchmark-sensitive code on the maintained Release optimization profile.
  3. Keep custom hash tables or similar low-level performance utilities in separate owning .h/.cpp modules, not embedded in large renderer, provider, or controller files.

Fix Discipline

  1. Change one coherent hypothesis at a time.
  2. Keep edits scoped to the owning subsystem and the regressed benchmark path.
  3. Preserve user-visible behavior unless the user explicitly asks for a behavior change; update the owning behavior docs when behavior changes.
  4. Rebuild and rerun the affected benchmark after each serious experiment.
  5. If an experiment regresses, is neutral without improving code clarity, or contradicts the benchmark log, revert only your own experiment changes and record the rejected shared result in docs/profile_benchmark.md.
  6. Keep retained optimizations only when direct benchmark data supports them and the final validation set remains healthy.
  7. Add concise comments only where a non-obvious code shape preserves a measured performance invariant.

Final Validation

Documentation

Update the matching docs/performance/<machine>.md file when:

Update docs/profile_benchmark.md when:

Keep entries present-tense and concise. Record commands, representative timing lines, hotspot evidence when used, retained or rejected conclusion, and the reason the result matters.

Update other maintained docs only when behavior, commands, architecture boundaries, diagnostics contracts, provider requirements, or build validation rules change.

Output

Summarize:

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.