pasture-performance
Use when a pasture read, replay, hook or query is slow, or before claiming a speedup. Covers the session replay path, query plans, benchmarks, invariants, and the evidence a speedup needs.
- License 许可
- MIT
- 最近更新
- 2026-11-11
- Stars
- ★ 2
- Forks
- 0
01 前言 Front Matter
- name
- pasture-performance
- description
- Use when a pasture read, replay, hook or query is slow, or before claiming a speedup. Covers the session replay path, query plans, benchmarks, invariants, and the evidence a speedup needs.
03 SKILL.md 正文
Pasture performance
Source of truth: pasture/docs/benchmarks/session-replay.md (workload,
measured costs, invariants, how to measure). Read it first. This skill is the
procedure; the runbook is the record.
Read before you measure
pasture/docs/benchmarks/session-replay.mdpasture/docs/dbos-architecture.md(durable runtime, queues, system DB)pasture/AGENTS.md(dependency pins, timeout table, quality gates)
Hot path
flowchart LR
R[session read] --> S[pin one snapshot]
S --> P[page query: one branch per kind]
P --> G[kind guard: indexed column first]
G --> D[decode + digest check]
D --> T[transition replay]
T --> F[page ref set: one admission per key]
F --> W[publish: fence on watermark + cache version]
W --> C{journal advanced?}
C -- yes, budget left --> S
C -- no --> E[coherent cache]
Rules
- Measure first. Restore a copy of the store and open it read-only. Never benchmark the live store while the daemon serves it.
- Count work, not only time. Wall-clock is noisy on CI. Count queries,
definition resolutions, rows scanned, or pages. The committed proof for the
definition set is a count: two rows sharing a ref set must make four
LookupCommittedcalls, not eight. - A speedup needs a call-site test. The test must fail when the optimization is removed and when the boundary it guards is disabled. Helper unit tests alone do not pin the production path.
- Keep the invariants. One pinned snapshot per scan; fence on publications
(
completed_through_jid,cache_version), never on ordinary writes; a publication clearsdirty; a definition key is complete by construction and page-scoped. - Measure the whole path. A query fix can expose the next cost (definition resolution, per-row decode). Re-measure after each change.
- Run the gates.
make test;make test-performancefor the write lane. Read-path changes get an independent A/B/C review wave. - Prefer an exit-status command over a log grep.
pasture rebuild sessionrebuilds and exits; use its exit code.
Commands
pasture rebuild session # catch up, unbounded, exits when published
pasture rebuild session --full # discard and replay the whole journal
pasture serve --backfill # rebuild, then serve
make test-performance # lane acceptance row + load harness
Query plan check: EXPLAIN QUERY PLAN for the page statement must show one
index seek per kind, no MATERIALIZE of journal_attributed, and no temp
B-tree over the remaining range.
Anti-patterns
- A multi-kind
INwithORDER BY journal_id: it cannot stream, so it sorts the remaining range on every page. - Joining
journal_attributed: SQLite materializes the whole-journal view per page. - A guard that leads with
journal_idand filtersevidence_kindafter. - Fencing a replay on
revisionordirty: ordinary writes bump both. - Resolving the same definition refs on every row.
- Grepping a server log for readiness instead of waiting on an exit status.
- Reporting a speedup from a deleted temporary harness. Commit the count-based test; keep the wall-clock numbers in the runbook.
04 同仓库更多 Skills
afk-implement
Run an unattended ("AFK") implementation session as the supervisor — scope small progressive iterations, push feature branches, open pull requests, drive review waves to clean, and never merge. Use when the user says they are going AFK or to bed, asks for overnight autonomous implementation, says "don't block on me", "open PRs but don't merge", "progressive adoption", or "stack changes".
protocol
Aura protocol reference documentation — 12-phase workflow, agent roles, constraints, and coding standards. Read when you need to understand the full workflow or look up conventions.
protocol
暂无简介
example
暂无简介
example
暂无简介
example
暂无简介