You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Make each streamed draft update cheaper to commit on mobile #1839
Problem. After #1811 the mobile DM keeps up with a streamed reply, and React only re-renders the growing tail of the draft (0 MessageBubble renders per draft update, 3–4 BlockView renders per update). But each draft update still costs about 120 ms of JS. So the draft redraws about 4 times a second, although draftDelayMs (50 ms) allows 20. JS stays 40–47% busy during a stream.
Evidence (iOS 18.6 simulator, dev build, the same 1,680-word reply replayed at a fixed rate, 3 runs with apps/mobile/scripts/rn-profile.mjs):
Fabric completeRoot / replaceContainerChildren: 34% of JS self time (9.6–9.9 s per ~56 s stream).
React DEV console.createTask: about 20%. It does not exist in release builds.
GC: about 5%. No app function is in the top 40.
226–237 frames over 50 ms per stream, longest 0.8–1.2 s.
Not measured: UI-thread FPS and native dropped frames.
Add a release-build (or __DEV__ = false) run, so the DEV overhead is removed from the numbers.
Add UI-thread frame timing, for example with xctrace.
Then reduce the cost of each native commit for the draft. Options to compare:
Keep the growing tail block's host view tree small (for example one Text per block instead of nested inline views).
Split the tail block so finished lines stop changing.
Adapt the draft redraw rate to the measured commit cost.
Record before and after numbers in the PR.
Done when: in a release build, a draft update's JS cost is well under one frame budget, and the stream shows no frames over 50 ms on the reference scenario.
Task claude-code/local/03081932-a680-44a7-bb8e-76677b7b0c7b: handed off. This issue was closed as a duplicate; the work continues under #1838 / #1804 on branch claude/1838-enriched-markdown.
Activity
DoodleBears commentedon Oct 14, 2026
Agent work claim
claude-code/local/03081932-a680-44a7-bb8e-76677b7b0c7b(not a DSH Session)claude/1839-enriched-markdownDoodleBears commentedon Oct 14, 2026
Task
claude-code/local/03081932-a680-44a7-bb8e-76677b7b0c7b: handed off. This issue was closed as a duplicate; the work continues under #1838 / #1804 on branchclaude/1838-enriched-markdown.