Lintel on GitHub Copilot. Generated from skills/perfbench/SKILL.md; edit the canonical file, then run
li-copilot init.
- Resource root:
../../.. from this skill's base directory (the Lintel source with bin/,
lib/, skills/). Write plans, state and evidence into the working repository's .claude/
tree, never into the resource root.
- Skill-relative paths: this skill's own
scripts/, references/ and data/ folders (and a
<base> that the workflow defines as its own directory) mean
../../../skills/perfbench/ in the Lintel source, not this generated folder.
${LINTEL_SKILLS_DIR:-skills} means the skills root, ../../../skills. A bin/li-run step
runs in the working repository, so use $LINTEL_SKILLS_DIR/perfbench/ there.
- Shell steps: run Bash snippets with Bash (Git for Windows'
bash.exe on Windows, never
System32\bash.exe). Save a snippet to a temporary .sh file and run
bash "<resource root>/bin/li-run" <file>; it prepares LINTEL_SOURCE_ROOT, LINTEL_REPO_ROOT
and the profile context.
- Tools: Read=
view, Write=create, Edit=edit, Bash=bash/powershell, Grep=grep,
Glob=glob, AskUserQuestion=ask_user, TodoWrite=the plan checklist, Task or a named role=task
with that custom agent, WebFetch=web_fetch.
- Other Lintel workflows are native skills: invoke
/li-<name> rather than reading their
files. Named roles such as CodeReviewer are custom agents.
/perfbench
Performance measurement with an explicitly selected comparable baseline. Uses the
repo's existing suite or an authorized named scenario, preserving every observation.
Not a profiler — that's PerformanceAnalyzer subagent territory. This skill is for repeatable measurement gates.
When to use
- Pre-
/li-ship regression check on perf-sensitive code paths
- After a hot-path refactor, confirm you didn't slow things down
- Periodic baseline capture for trend monitoring
- A teammate said "this feels slower" — instrument it
When NOT to use
- One-off profiling to find a bottleneck — use
PerformanceAnalyzer subagent
- No benchmark suite exists and no scenario can be defined — set one up first
- Comparing against a CI machine baseline from your laptop — apples to oranges, results misleading
Inputs
- Optional
--suite <name> — named benchmark suite (default: repo's bench script)
- Optional
--scenario <name> — single named scenario (e.g. cold-start, large-list-render)
- Optional
--baseline <ref> — explicit comparable recorded baseline/ref, not newest file by mtime
- Optional
--iterations <N> — runs per scenario (default: 5, take median)
- Optional
--warmup <N> — warmup iterations not counted (default: 2)
- Optional
--save-as-baseline — record this run as the new baseline
Workflow
- Detect benchmark mechanism. Read the existing manifest/suite. If absent, obtain
a named scenario and explicit local invocation; do not invent a global config reader.
- Check effects. Inspect scripts/hooks/network/data before execution; local
commands can still mutate shared systems. Use owned synthetic home/temp and exact
target authority. Production/paid endpoints need their own explicit approval.
- Warmup. Distinguish steady-state from cold-start measurement; warming the
very cold-start path being measured invalidates that scenario.
- Measurement run. N iterations. Capture per-iteration metrics: wall time, peak memory, allocations (if available), cold-start time (if applicable).
- Aggregate. Report sample count, raw distribution and uncertainty. Five runs
cannot support precise p99 claims. Retain failures separately, never silently drop them.
An empirical percentile describes these samples, not a population guarantee.
Keep its estimator and sample count visible; if precision is not established, say so.
- Load baseline. Read the explicitly selected repository-local artifact and
verify source/env/workload/build/runtime identity. Missing baseline means no comparison,
not permission to replace history automatically.
- Diff. Report effect size versus the actual approved budget and baseline noise,
not blanket severity from 5/15/30 percent. Hand cause diagnosis to PerformanceAnalyzer.
- Persist. The authorized caller records named results under the selected safe
operation/iteration path.
--save-as-baseline needs an explicit owned destination,
original preimage and retained previous reference; no global store or silent overwrite.
- Report.
When part of TQ/mapped work follow the shared procedure
and comparison methods. Actual P05 tests/check
obligations are fixed before observations. Record runs/exits, environment, immutable
evidence and unrun scope; independent review and final QA are not a self-awarded score.
An unmapped measurement stays an inspection, not a new task ledger.
Report format
Benchmark: <repo> / <suite>
Suite: synthetic report shape; actual scenarios/samples/warmup and confidence recorded per run
Baseline: 20260520-114000 (git: f19d388)
Failures: <failure count and evidence>
## Results
| Scenario | Samples | Median | Empirical p95 | Tail uncertainty | Raw samples / artifact | Estimator | Memory | vs baseline |
|---|---|---|---|---|---|---|---|---|
| <scenario> | <N> | <median> | <empirical p95> | <tail uncertainty> | <raw samples or immutable sample artifact> | <estimator> | <memory> | <comparison and policy context> |
## Regressions
<regression rows linked to result scenarios, or none>
For each reported regression retain the matching scenario, baseline/current sample
references, observed effect and unverified cause hypothesis. Comparison alone does
not establish the cause; hand an authorized investigation to /diagnose.
## Recommendation
Assign severity from measured user impact and applicable policy; the illustrative
percent changes alone do not establish a blocker or acceptance exception.
Compliance integration
- Layer 2 production-mutation rule applies if a benchmark scenario hits production. Per-call auth required.
- Network-dependent benchmarks: warning if network conditions vary (results not comparable).
- Claim logging only after actual authorized persistence; a pathname is not a receipt.
Failure modes
- No benchmark mechanism found: report + suggest setting one up. Do not fabricate baseline.
- Insufficient sampling: state the unavailable inference; choose repetitions from
observed variance and meaningful effect size, not a universal minimum for all metrics.
- Iteration crashes: preserve failure/exit and incomplete scenario; no nonfinite
success record or averaging it away. Rerun only after effects/conditions are understood.
- Baseline corrupted: preserve it, block comparison and request an explicit new
baseline decision; deletion is not a recovery prerequisite.
- Remote flake: retain actual failure and authority boundary; skipped required
scenarios stay unverified, not a successful aggregate.
Examples
Standard run:
> /perfbench
[5 scenarios × 5 iterations]
Report observed changes, failures and uncertainty; severity needs actual impact/policy.
Single scenario, deeper sampling:
> /perfbench --scenario cold-start --iterations 20
[20 iterations retained; tail uncertainty stated, not a precise p99 guarantee]
Median and spread reported against an actually comparable baseline.
Set new baseline after refactor:
> /perfbench --save-as-baseline
[After explicit destination/preimage authority, persist and read back the baseline]
Report actual new and retained old paths/digests; a failed write is not a new baseline.
See also
PerformanceAnalyzer subagent — for finding the bottleneck once /perfbench flagged a regression
/verify — correctness; /perfbench is performance
/diagnose — for hypothesis-driven follow-up on a regression
/li-ship — consumes the actual required/advisory QA obligation; required performance failures block
1---2name: li-perfbench3description: Measure performance — runtime, memory, cold-start — and detect regressions vs baseline.4metadata:5 source: https://skillmd.com/skills/jokerman89/li-perfbench6---78> **Lintel on GitHub Copilot.** Generated from `skills/perfbench/SKILL.md`; edit the canonical file, then run9> `li-copilot init`.10> - **Resource root:** `../../..` from this skill's base directory (the Lintel source with `bin/`,11> `lib/`, `skills/`). Write plans, state and evidence into the working repository's `.claude/`12> tree, never into the resource root.13> - **Skill-relative paths:** this skill's own `scripts/`, `references/` and `data/` folders (and a14> `<base>` that the workflow defines as its own directory) mean15> `../../../skills/perfbench/` in the Lintel source, not this generated folder.16> `${LINTEL_SKILLS_DIR:-skills}` means the skills root, `../../../skills`. A `bin/li-run` step17> runs in the working repository, so use `$LINTEL_SKILLS_DIR/perfbench/` there.18> - **Shell steps:** run Bash snippets with Bash (Git for Windows' `bash.exe` on Windows, never19> `System32\bash.exe`). Save a snippet to a temporary `.sh` file and run20> `bash "<resource root>/bin/li-run" <file>`; it prepares `LINTEL_SOURCE_ROOT`, `LINTEL_REPO_ROOT`21> and the profile context.22> - **Tools:** Read=`view`, Write=`create`, Edit=`edit`, Bash=`bash`/`powershell`, Grep=`grep`,23> Glob=`glob`, AskUserQuestion=`ask_user`, TodoWrite=the plan checklist, Task or a named role=`task`24> with that custom agent, WebFetch=`web_fetch`.25> - **Other Lintel workflows** are native skills: invoke `/li-<name>` rather than reading their26> files. Named roles such as `CodeReviewer` are custom agents.2728# /perfbench2930Performance measurement with an explicitly selected comparable baseline. Uses the31repo's existing suite or an authorized named scenario, preserving every observation.3233Not a profiler — that's `PerformanceAnalyzer` subagent territory. This skill is for repeatable measurement gates.3435## When to use3637- Pre-`/li-ship` regression check on perf-sensitive code paths38- After a hot-path refactor, confirm you didn't slow things down39- Periodic baseline capture for trend monitoring40- A teammate said "this feels slower" — instrument it4142## When NOT to use4344- One-off profiling to find a bottleneck — use `PerformanceAnalyzer` subagent45- No benchmark suite exists and no scenario can be defined — set one up first46- Comparing against a CI machine baseline from your laptop — apples to oranges, results misleading4748## Inputs4950- Optional `--suite <name>` — named benchmark suite (default: repo's `bench` script)51- Optional `--scenario <name>` — single named scenario (e.g. `cold-start`, `large-list-render`)52- Optional `--baseline <ref>` — explicit comparable recorded baseline/ref, not newest file by mtime53- Optional `--iterations <N>` — runs per scenario (default: 5, take median)54- Optional `--warmup <N>` — warmup iterations not counted (default: 2)55- Optional `--save-as-baseline` — record this run as the new baseline5657## Workflow58591. **Detect benchmark mechanism.** Read the existing manifest/suite. If absent, obtain60 a named scenario and explicit local invocation; do not invent a global config reader.612. **Check effects.** Inspect scripts/hooks/network/data before execution; local62 commands can still mutate shared systems. Use owned synthetic home/temp and exact63 target authority. Production/paid endpoints need their own explicit approval.643. **Warmup.** Distinguish steady-state from cold-start measurement; warming the65 very cold-start path being measured invalidates that scenario.664. **Measurement run.** N iterations. Capture per-iteration metrics: wall time, peak memory, allocations (if available), cold-start time (if applicable).675. **Aggregate.** Report sample count, raw distribution and uncertainty. Five runs68 cannot support precise p99 claims. Retain failures separately, never silently drop them.69 An empirical percentile describes these samples, not a population guarantee.70 Keep its estimator and sample count visible; if precision is not established, say so.716. **Load baseline.** Read the explicitly selected repository-local artifact and72 verify source/env/workload/build/runtime identity. Missing baseline means no comparison,73 not permission to replace history automatically.747. **Diff.** Report effect size versus the actual approved budget and baseline noise,75 not blanket severity from 5/15/30 percent. Hand cause diagnosis to PerformanceAnalyzer.768. **Persist.** The authorized caller records named results under the selected safe77 operation/iteration path. `--save-as-baseline` needs an explicit owned destination,78 original preimage and retained previous reference; no global store or silent overwrite.799. **Report.**8081When part of TQ/mapped work follow [the shared procedure](../../../skills/full-engineering-pass/references/domain-handoff.md#module-caller-procedure)82and [comparison methods](../../../skills/tq/references/decision-methods.md). Actual P05 tests/check83obligations are fixed before observations. Record runs/exits, environment, immutable84evidence and unrun scope; independent review and final QA are not a self-awarded score.85An unmapped measurement stays an inspection, not a new task ledger.8687## Report format8889```90Benchmark: <repo> / <suite>9192Suite: synthetic report shape; actual scenarios/samples/warmup and confidence recorded per run93Baseline: 20260520-114000 (git: f19d388)94Failures: <failure count and evidence>9596## Results9798| Scenario | Samples | Median | Empirical p95 | Tail uncertainty | Raw samples / artifact | Estimator | Memory | vs baseline |99|---|---|---|---|---|---|---|---|---|100| <scenario> | <N> | <median> | <empirical p95> | <tail uncertainty> | <raw samples or immutable sample artifact> | <estimator> | <memory> | <comparison and policy context> |101102## Regressions103<regression rows linked to result scenarios, or none>104For each reported regression retain the matching scenario, baseline/current sample105references, observed effect and unverified cause hypothesis. Comparison alone does106not establish the cause; hand an authorized investigation to /diagnose.107108## Recommendation109Assign severity from measured user impact and applicable policy; the illustrative110percent changes alone do not establish a blocker or acceptance exception.111```112113## Compliance integration114115- Layer 2 production-mutation rule applies if a benchmark scenario hits production. Per-call auth required.116- Network-dependent benchmarks: warning if network conditions vary (results not comparable).117- Claim logging only after actual authorized persistence; a pathname is not a receipt.118119## Failure modes120121- **No benchmark mechanism found:** report + suggest setting one up. Do not fabricate baseline.122- **Insufficient sampling:** state the unavailable inference; choose repetitions from123 observed variance and meaningful effect size, not a universal minimum for all metrics.124- **Iteration crashes:** preserve failure/exit and incomplete scenario; no nonfinite125 success record or averaging it away. Rerun only after effects/conditions are understood.126- **Baseline corrupted:** preserve it, block comparison and request an explicit new127 baseline decision; deletion is not a recovery prerequisite.128- **Remote flake:** retain actual failure and authority boundary; skipped required129 scenarios stay unverified, not a successful aggregate.130131## Examples132133**Standard run:**134```135> /perfbench136[5 scenarios × 5 iterations]137Report observed changes, failures and uncertainty; severity needs actual impact/policy.138```139140**Single scenario, deeper sampling:**141```142> /perfbench --scenario cold-start --iterations 20143[20 iterations retained; tail uncertainty stated, not a precise p99 guarantee]144Median and spread reported against an actually comparable baseline.145```146147**Set new baseline after refactor:**148```149> /perfbench --save-as-baseline150[After explicit destination/preimage authority, persist and read back the baseline]151Report actual new and retained old paths/digests; a failed write is not a new baseline.152```153154## See also155156- `PerformanceAnalyzer` subagent — for finding the bottleneck once `/perfbench` flagged a regression157- `/verify` — correctness; `/perfbench` is performance158- `/diagnose` — for hypothesis-driven follow-up on a regression159- `/li-ship` — consumes the actual required/advisory QA obligation; required performance failures block