Performance Guidelines
sharedBaseline performance review criteria for backend and frontend changes.
Backend baseline
- avoid unbounded list queries
- use pagination and indexed filters
- prefer projection/query services for list endpoints
- use async queues for heavy non-critical operations
Frontend baseline
- avoid expensive render loops
- avoid repeated waterfall fetch patterns
- paginate or virtualize large lists
- keep shared UI usage consistent to avoid drift
Review checklist
- Any N+1 or unbounded query risks?
- Any oversized payload or expensive render path?
- Are baseline checks green?
Minimum checks
bun run typecheck
bun run depcruise:backend
bun run depcruise:frontend
bun run --filter @athas/admin-console build
bun run --filter @athas/client-console buildBaseline instrumentation
Use the baseline tooling to measure command durations against configured budgets:
bun run perf:baseline
bun run perf:baseline:enforce
bun run storybook:perf
bun run storybook:perf:enforceArtifacts and budgets live in docs/performance/.
Storybook metrics
- Measure Storybook build duration and emitted asset sizes from
dist/storybook/assets. - Track total bundle bytes, JS bytes, CSS bytes, and largest asset size.
- Keep thresholds in
docs/performance/budgets.jsonand adjust intentionally when component surface area grows.