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
Mobile: Cut the per-update native commit cost of the streaming draft bubble #1838
After #1811 (closes #1803), a streamed reply no longer re-renders the rest of the DM:
MessageBubble renders 0 times per draft update.
About 71 components render per commit, against 894–1,535 before.
Closed Markdown blocks are reused.
Each draft update still costs about 120 ms of JS on the dev build (iPhone 16 Pro Simulator, iOS 18.6, one 1,682-word reply replayed at 4 characters every 16 ms). The time goes to:
Fabric completeRoot / replaceContainerChildren: 34% of JS time.
React DEV createTask: 20%, which a release build does not have.
GC: 5%.
As a result:
The screen draws about 4 draft updates a second, while the 50 ms batching would allow 20.
JS FPS during a stream is 34–43.
A stream has 226–237 frames over 50 ms.
UI-thread FPS, native dropped frames and release-build numbers have not been measured.
Measured with apps/mobile/scripts/rn-profile.mjs; the full numbers are in the #1811 description. (Also filed as #1839, closed as a duplicate of this.)
Smallest useful scope / 最小有用范围
Included:
Measure the release build first, and the UI thread through xctrace (Time Profiler / Animation Hitches) or the Performance Monitor. Find where the per-update native commit cost goes.
Add UI-thread frame timing to the profiling loop in apps/mobile/AGENTS.md if it can be read from the command line.
Reduce the cost with the cheapest change the profile points to, for example:
keep only the growing tail block as the node that changes, and slim its native view tree;
split the tail block;
avoid re-laying out the list cell on each update;
adapt the batching interval to the measured commit time.
Task: claude-code/local/03081932-a680-44a7-bb8e-76677b7b0c7b (not a DSH Session)
Issue scope: render chat Markdown with react-native-enriched-markdown (native text), DraftBubble first then MarkdownView everywhere; streaming drafts closed with remend; ABBA profile against main incl. release build if possible
Remaining scope: in production JS each stream still has 3–4 frames of ~100 ms (the issue's "no frames over 50 ms" is not fully met); a store Release build and UI-thread frames were not measured; on iOS the nested-list bullet sits against its text and links render in the ink colour instead of the accent.
Activity
DoodleBears commentedon Oct 14, 2026
Agent work claim
claude-code/local/03081932-a680-44a7-bb8e-76677b7b0c7b(not a DSH Session)claude/1838-enriched-markdownAdd native iOS evidence for the native Markdown DM
Render mobile chat Markdown as native text (react-native-enriched-mar…
DoodleBears commentedon Oct 15, 2026
Agent work outcome
claude-code/local/03081932-a680-44a7-bb8e-76677b7b0c7b