#64883·zed

Restoring one large agent thread saturates the UI for ~30-60 s at startup (A/B vs empty thread)

Author: ihivaRitikCreated Sep 28, 2026Updated Sep 28, 2026
Labelsstate:needs triage

What: On 1.21 (Linux/NixOS, 15 GB RAM, 8 cores), launching with one large agent thread (4.4 MB stored, ~28 MB JSON) in the panel costs 30–60 s of input lag (terminal + chat), then smooths out.

Measured A/B — same build, same workspace, only the panel's thread differs (numbers from Zed's own gpui churn lines + hang traces):

first 90 s after launch large thread restored empty thread
hang detections 12 (incl. all 8 workers flagged at +2 s) 8 (routine only: extension-host wasm ×4, language-registry ×2, project-environment ×2, all ≤220 ms)
thread-parse errors 35 0
language not found (diff restore) 33 0
entities created in one 30 s window 54,436 455
flush_effects ≥1000/s ~90 s none

Loading the same thread on demand after startup costs 14,406 entities, +511 MiB, and one 346 ms foreground hang (agent_ui/conversation_view.rs:1107).

Read: the startup cost is dominated by building the thread's view (tens of thousands of GPUI entities), not workspace/extension startup. Deferring conversation-history construction until the panel is actually visible (or restoring it progressively during idle) would likely remove most of the first-minute saturation. The diff-language race in the same restore path is a separate small bug (fixed by a local patch; happy to send as a PR).

Measured on a locally built 1.21; the A/B is same-binary, only the panel state differs. Full log excerpts and the census script available on request.