Skip to content

perf(mobile): preserve Markdown views while streaming - #9664

Closed
t3dotgg wants to merge 1 commit into
mainfrom
t3code/perf-mobile-markdown-identity
Closed

perf(mobile): preserve Markdown views while streaming#9664
t3dotgg wants to merge 1 commit into
mainfrom
t3code/perf-mobile-markdown-identity

Conversation

@t3dotgg

@t3dotgg t3dotgg commented Sep 4, 2026

Copy link
Copy Markdown
Member

Streaming Markdown used growing end offsets and text in React keys. Each update could replace the active text view, code block, and scroll container.

Keep block keys tied to type and start position. Keep text-run and code-token keys stable as content grows. Formatting and block-type changes still get separate identities.

Checked:

  • 49 focused Markdown tests passed.
  • Mobile typecheck, targeted lint, and formatting passed. Two existing React lint warnings remain in the code-block renderer.
  • The locked C++ parser confirmed stable keys for prose, open and closed fences, tables, nested code, and completed blocks. A paragraph-to-heading change gets a new key.

No browser or device testing, as requested. Selection, copy feedback, and horizontal scrolling have source checks only. No native source or configuration changed.

Merge hold: CI detects an iOS fingerprint change because Expo hashes the whole local Markdown module. This needs a native-release merge window under the current fingerprint policy.

Part of the performance audit.

Created with GPT-6 Astra (preview) in Codex.

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:L 100-499 changed lines (additions + deletions). 📱 Native Change Changes the native fingerprint; merging blocks production OTAs until a new store build ships. labels Sep 4, 2026
@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Thread transfer impact

✅ Thread transfer remains within every enforced ceiling.

Provider Metric Main baseline This PR Impact PR ceiling
Codex Total thread wire 13.5 KiB 13.7 KiB +237 B (+1.7%) 15.1 KiB
Codex Thread snapshot wire 7.0 KiB 7.0 KiB −3 B (−0.0%) 7.3 KiB
Codex Live turn WebSocket wire 6.5 KiB 6.7 KiB +240 B (+3.6%) 7.8 KiB
Codex Live turn WebSocket decoded 57.0 KiB 58.5 KiB +1.5 KiB (+2.6%) 66.4 KiB
Codex Live turn messages 8 10 +2 (+25.0%) 21
Claude Total thread wire 13.7 KiB 13.6 KiB −158 B (−1.1%) 15.1 KiB
Claude Thread snapshot wire 7.0 KiB 7.0 KiB +1 B (+0.0%) 7.3 KiB
Claude Live turn WebSocket wire 6.7 KiB 6.6 KiB −159 B (−2.3%) 7.8 KiB
Claude Live turn WebSocket decoded 59.3 KiB 57.9 KiB −1.4 KiB (−2.4%) 66.4 KiB
Claude Live turn messages 10 10 0 (0.0%) 21

Baseline: caa8a0d · PR result: 36318af · Source CI: success

Scenario and decoded snapshot size

10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.

  • Codex decoded thread snapshot: 113.8 KiB
  • Claude decoded thread snapshot: 114.5 KiB

Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.

@macroscopeapp

macroscopeapp Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at 36318af

Macroscope's review found this PR approvable — The PR narrowly stabilizes iOS Markdown component identities during streaming, preserving existing text, code, and block views while still remounting when rendering attributes or node types change. The implementation is covered by focused tests and introduces no schema, deployment, security, billing, or product-default changes.

You can add or adjust custom eligibility rules. Learn more.

@juliusmarminge

Copy link
Copy Markdown
Member

Superseded by #11211 (perf(mobile): reuse completed code lines while streaming), which landed the stable Markdown sibling keys (offset:<beg> / index:<i>) plus incremental completed-line highlight reuse on main. Closing this older native-hold PR as wash leftover hygiene.

@juliusmarminge

Copy link
Copy Markdown
Member

Closed as superseded by #11211.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

📱 Native Change Changes the native fingerprint; merging blocks production OTAs until a new store build ships. size:L 100-499 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants