Description
Profile Dialogue under realistic load — large transcripts, rapid token streams, long tool outputs — and tune throttling / caching / virtualization to keep UI responsive.
Spec: Epic #250 §11 Risks rows 6-7.
Scope
Scenarios
- Rapid token stream — mock session producing 100 text_deltas/sec for 30s. Expected: UI stays responsive, FPS ≥ 30, main-thread CPU < 50%.
- Long transcript — 500+ messages accumulated. Scroll performance should stay smooth (LazyVStack +
.id() stability).
- Large tool output —
Bash returning 1 MiB stdout. Expected: truncation works, no UI freeze; expand to full result opens quickly.
- Many tool calls — 50+ tool cards in one message. Expected: card rendering stays under a frame budget.
- Markdown re-render — 50KB single assistant message with mixed content; streaming mode.
Instrumentation
- Use Instruments (Time Profiler, SwiftUI instrument, Memory).
- Add
signpost markers around:
- Parser ingest per event.
- Reducer action processing.
- Markdown parse + render.
- Scroll updates.
Tuning
MarkdownBlockCache LRU size — default 128, verify no eviction of hot blocks under normal load.
- Throttle frequency — 30fps default; verify perceived smoothness.
IdentifiedArrayOf<AgentMessage> update cost — ensure no full-array copy on textDelta.
- Scroll virtualization — LazyVStack stability via stable
.id() per message.
Escalation
If metrics fail significantly — escalate to performance-expert agent with profiling artifacts.
Acceptance Criteria
Relationships
Description
Profile Dialogue under realistic load — large transcripts, rapid token streams, long tool outputs — and tune throttling / caching / virtualization to keep UI responsive.
Spec: Epic #250 §11 Risks rows 6-7.
Scope
Scenarios
.id()stability).Bashreturning 1 MiB stdout. Expected: truncation works, no UI freeze; expand to full result opens quickly.Instrumentation
signpostmarkers around:Tuning
MarkdownBlockCacheLRU size — default 128, verify no eviction of hot blocks under normal load.IdentifiedArrayOf<AgentMessage>update cost — ensure no full-array copy on textDelta..id()per message.Escalation
If metrics fail significantly — escalate to performance-expert agent with profiling artifacts.
Acceptance Criteria
Relationships