Skip to content

perf(ui): speed up formatted transcript search - #190238

Merged
steipete merged 1 commit into
mainfrom
solid2/w-perf-transcript-search-1101
Nov 1, 2026
Merged

steipete merged 1 commit into
mainfrom
solid2/w-perf-transcript-search-1101

Conversation

@steipete

@steipete steipete commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Transcript search reparses ordinary prose as Markdown while a reader types, adding work to every search through a large conversation.

User Impact

Search stays responsive while preserving formatted-text matches, source/link-target matches, Unicode matching, recovered replies, and visible highlights from #170434. Thanks to @holgergruenhagen for that correctness fix.

Why This Change Was Made

Source-mapped traces of the 400-message chat-actions-search scenario attributed about 10 ms to cold visible-text parsing, versus roughly 1 ms to highlight refresh. The existing visible-text owner now skips parsing for unambiguous letter-led prose lines and keeps its existing immutable-message cache. Everything with potentially significant Markdown syntax still uses the original parser. Each filter pass prepares the query once for its messages. The highlight owner and transcript windowing are unchanged.

Evidence

Acceptance was set before measurement: 20 serial base/head/base-control triplets for Chromium and WebKit, desktop and mobile, localhost 1×; retain the 11 typed characters, matching-row assertion, close, draft preservation, and focus restoration. Review medians, p95s, ranges, and A/A controls; no attributable regression beyond the campaign's band. This is the production renderer with a synthetic Gateway, not provider-latency proof.

All 240/240 observations passed (20 triplets per engine/viewport); every action recorded 26 native input events, one matching message, no action RPCs, and preserved the focused draft on close. Chromium recorded zero long tasks. Host 1-minute load was 9.86–16.36. A/A script medians changed +0.14% desktop / +0.89% mobile.

Times below are median / p95 in ms. Chromium script/task use thread CPU; WebKit application time uses native input-to-last-DOM-commit elapsed time, not CPU.

Cell Base Head Base control Head median Δ
Chromium desktop script 124.15 / 135.32 112.95 / 121.97 124.33 / 134.27 -9.02%
Chromium desktop task 263.50 / 284.91 253.80 / 263.81 264.01 / 284.42 -3.68%
Chromium mobile script 127.62 / 136.86 113.62 / 121.87 128.76 / 133.49 -10.97%
Chromium mobile task 235.05 / 250.85 218.56 / 234.84 237.37 / 244.16 -7.01%
WebKit desktop application 442.50 / 473.00 426.50 / 451.00 448.00 / 468.00 -3.62%
WebKit mobile application 379.00 / 404.00 373.50 / 396.00 377.00 / 407.00 -1.45%

The mobile script median is 113.62 ms, still 6.52 ms above the historical 107.1 ms target. This lands the measured search-owner win without changing the highlighter or the separately owned transcript-windowing work. The final diagnostic profiles place the remaining dominant cost in transcript grouping, rendering and layout; further search-owner changes are not justified by those samples. All wall/application and input-frame p95s hold or improve. Desktop style/layout medians moved +1.01%/+0.83%, with better p95s, within the stated band.

Full distributions and A/A controls (median / p95, min–max)
Engine / viewport / metric Base median / p95 (range) Head Base control Head median Δ A/A median Δ
chromium / desktop / script 124.15 / 135.32 (118.17–136.51) 112.95 / 121.97 (101.53–130.26) 124.33 / 134.27 (118.34–137.25) -9.02% 0.14%
chromium / desktop / task 263.50 / 284.91 (254.06–287.26) 253.80 / 263.81 (228.80–286.96) 264.01 / 284.42 (252.86–290.63) -3.68% 0.19%
chromium / desktop / style 84.07 / 89.32 (80.67–89.61) 84.92 / 88.35 (73.98–90.53) 84.46 / 87.61 (79.91–87.80) 1.01% 0.46%
chromium / desktop / layout 10.02 / 11.03 (9.60–11.33) 10.11 / 10.84 (8.46–11.64) 10.01 / 10.91 (9.43–10.98) 0.83% -0.19%
chromium / desktop / application 405.80 / 432.40 (402.40–436.90) 389.20 / 405.90 (368.10–444.60) 405.85 / 421.20 (400.70–462.50) -4.09% 0.01%
chromium / desktop / wall 511.22 / 539.38 (494.51–541.04) 501.39 / 510.83 (476.28–588.53) 510.86 / 527.03 (493.92–643.93) -1.92% -0.07%
chromium / desktop / input-frame-p95 22.75 / 24.70 (20.80–26.10) 22.10 / 23.00 (19.00–23.40) 22.85 / 24.00 (20.50–24.30) -2.86% 0.44%
chromium / desktop / long-tasks 0.00 / 0.00 (0.00–0.00) 0.00 / 0.00 (0.00–0.00) 0.00 / 0.00 (0.00–0.00) — —
chromium / desktop / mutations 1611.00 / 1841.00 (1610.00–1841.00) 1606.50 / 1841.00 (1107.00–1841.00) 1610.50 / 1841.00 (1602.00–1841.00) -0.28% -0.03%
chromium / mobile / script 127.62 / 136.86 (119.45–137.37) 113.62 / 121.87 (104.26–126.73) 128.76 / 133.49 (123.31–133.71) -10.97% 0.89%
chromium / mobile / task 235.05 / 250.85 (216.91–251.27) 218.56 / 234.84 (197.91–247.84) 237.37 / 244.16 (225.00–248.04) -7.01% 0.99%
chromium / mobile / style 59.10 / 62.69 (53.66–63.83) 56.62 / 62.65 (51.31–63.68) 59.56 / 62.95 (56.23–63.21) -4.20% 0.78%
chromium / mobile / layout 9.31 / 9.94 (8.09–10.13) 8.97 / 9.82 (7.70–10.01) 9.36 / 9.96 (8.48–10.00) -3.64% 0.61%
chromium / mobile / application 373.25 / 392.90 (354.80–394.30) 358.95 / 374.60 (336.70–392.60) 374.75 / 386.50 (364.80–388.50) -3.83% 0.40%
chromium / mobile / wall 485.86 / 511.58 (460.77–512.32) 469.18 / 479.05 (444.82–561.08) 486.77 / 508.91 (476.14–510.97) -3.43% 0.19%
chromium / mobile / input-frame-p95 19.95 / 25.90 (16.30–30.70) 17.20 / 19.50 (16.30–22.50) 20.35 / 23.90 (17.00–24.00) -13.78% 2.01%
chromium / mobile / long-tasks 0.00 / 0.00 (0.00–0.00) 0.00 / 0.00 (0.00–0.00) 0.00 / 0.00 (0.00–0.00) — —
chromium / mobile / mutations 1291.00 / 1458.00 (1291.00–1463.00) 1126.00 / 1291.00 (1125.00–1291.00) 1291.00 / 1458.00 (1291.00–1463.00) -12.78% 0.00%
webkit / desktop / application 442.50 / 473.00 (416.00–479.00) 426.50 / 451.00 (388.00–452.00) 448.00 / 468.00 (415.00–479.00) -3.62% 1.24%
webkit / desktop / wall 578.24 / 611.91 (547.17–612.30) 561.80 / 578.41 (528.05–578.57) 577.88 / 595.54 (546.26–595.77) -2.84% -0.06%
webkit / desktop / input-frame-p95 38.00 / 42.00 (29.00–58.00) 32.50 / 37.00 (26.00–38.00) 38.00 / 44.00 (29.00–44.00) -14.47% 0.00%
webkit / desktop / mutations 1853.00 / 1853.00 (1850.00–1859.00) 1853.00 / 1853.00 (1355.00–1853.00) 1853.00 / 1853.00 (1850.00–1853.00) 0.00% 0.00%
webkit / mobile / application 379.00 / 404.00 (362.00–414.00) 373.50 / 396.00 (352.00–396.00) 377.00 / 407.00 (372.00–409.00) -1.45% -0.53%
webkit / mobile / wall 530.74 / 551.77 (510.59–558.44) 528.22 / 545.10 (497.48–545.19) 529.46 / 545.74 (512.52–561.03) -0.48% -0.24%
webkit / mobile / input-frame-p95 38.00 / 42.00 (27.00–42.00) 38.00 / 42.00 (24.00–42.00) 38.00 / 44.00 (28.00–48.00) 0.00% 0.00%
webkit / mobile / mutations 1455.00 / 1459.00 (1455.00–1459.00) 1455.00 / 1459.00 (1290.00–1459.00) 1455.00 / 1458.00 (1455.00–1458.00) 0.00% 0.00%

Host load (1 min): 9.86–16.36

Check Result
Production builds + strict asset checks Pass on base and head; startup 90,446 → 90,449 B gzip, 1 CSS request; chat boot 1,274,181 → 1,274,273 B gzip
pnpm tsgo:ui Pass
Search owner tests 20 passed; final file run 871 ms
Highlight browser owner 3 passed; file run 1.69 s
Targeted lint / format / git diff --check Pass
Production Knip (pnpm deadcode:knip) Pass; 1m37s
Independent Codex autoreview, P0–P2 Scoped-clean against ea19b6f716c, with unchanged parser/plugin context; no actionable findings
Before/after captures Inspected synthetic desktop/mobile formatted queries; both retain the same text/code highlight spans; mobile PNG bytes identical

The new test coverage protects whitespace-spanning prose, Unicode simple folding, and ordered-list markers. One fixture initially compared a trailing newline that the existing message normalizer trims; the corrected fixture passes. No retries were used to conceal a product failure.

Touched production LOC: 1,742 → 1,747 (+5); tests +12. The additional code is the narrow prose check and a shared query-preparation closure. Refactor-checklist counts remain zero for effects, render effects, untrack, direct DOM listeners/queries, flush, and owner APIs in the four touched production files. No dependency, public API, configuration, or lazy-boundary change.

Before: formatted search on desktop with synthetic messages

After: formatted search on desktop with the same highlighted spans

Before: formatted search on mobile with synthetic messages

After: formatted search on mobile with the same highlighted spans

CI attribution

The full UI run 41297490931 reports these inherited failures:

  • Solid preserves presentation contracts in light desktop
  • Solid preserves presentation contracts in light mobile
  • Solid preserves presentation contracts in dark desktop
  • Solid preserves presentation contracts in dark mobile
  • starts an empty cloud workspace before the default folder Git check finishes

The same cases and assertions fail in completed UI jobs of scheduled main run 41297432333: presentation job 124821331979, and empty workspace job 124821331928. The older completed scheduled main run 41293098118 also has the identical empty-workspace assertion. The current scheduled run is still in progress at this observation; the cited UI jobs are complete.

The presentation failures lose background, overflow and radius when the fixture moves the skeleton into a fresh shadow root. The empty-workspace test expects a visible description but receives New workspace . Ten relevant owner, stylesheet, fixture and test blobs are identical between CI's tested merge 2a23608d3dd5a7c1de4119f5dfdf19871c8c0466, its protected-main parent 0f548caee9b81f60673d13efe2311fcf046a542a, and the scheduled-main head. The tested PR merge changes only the six transcript-search files. The empty-workspace log redacts the full title; the name above comes from that unchanged file's sole test.

Auto-merge was retired through native recovery; the reviewed head is unchanged. The full PR run is complete: {'success': 40, 'failure': 3, 'skipped': 25}. The only failed nonaggregate jobs are the two inherited UI jobs above; independent security-fast passed. Native inherited-failure admission retains the failed CI result rather than describing it as green.

Keep formatted-text, source-link, Unicode, and recovered-message search from #170434 while skipping Markdown parsing for unambiguous prose and preparing each query once per filter pass. Preserve the highlight owner and its viewport lifecycle. Thanks to @holgergruenhagen for the original correctness fix.
@steipete steipete added the ci:full Keep ordinary native-locale CI selection on the next PR run. label Nov 1, 2026
@clawsweeper

clawsweeper Bot commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-01T10:28:29.262469Z 115413b PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@steipete
steipete enabled auto-merge (squash) November 1, 2026 10:33
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 1, 2026
@steipete
steipete disabled auto-merge November 1, 2026 10:37
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 1, 2026
@clawsweeper

clawsweeper Bot commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR skips Markdown parsing for unambiguous prose and prepares transcript search queries once per filter pass.

Example: Search a 400-message conversation for “message 17.” in Chromium mobile.

  • Before: Reported median script CPU is 127.62 ms.
  • After: Reported median script CPU is 113.62 ms, with one matching message and the draft preserved when search closes.

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) A small, coherent optimization with production-browser evidence, preserved correctness contracts, and no actionable findings.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (screenshot): The production Control UI renderer was exercised through native browser search input against a synthetic Gateway in Chromium and WebKit desktop/mobile. The supplied campaign reports successful matching, close, draft preservation, focus restoration, and improved timings; inspected before/after captures preserve formatted highlights. These results establish renderer behavior, not live Gateway or provider latency.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Product

Kind: Performance · Worth it: Yes · Fix scope: Complete
User problem: Typing a search query through a large conversation spends avoidable browser CPU preparing queries and parsing ordinary prose.
Reason: The maintainer-authored direction is established, the measured renderer gain is concrete, and the implementation adds no configuration, public contract, or separate state owner.

Merge readiness

✅ Ready for maintainer review

Keep open: this PR delivers a focused, measured search optimization with no actionable code findings; inherited browser-test failures still leave the required CI gate red.

Priority: P2
Reviewed head: 115413bf23dd2c998279aede68c2d7044d3650d3

Before merge

None.

Findings

None.

Agent review details

How this fits together

The Control UI projects loaded and recovered messages into searchable transcript rows; source text and rendered-text projections determine visibility, while the existing highlight owner marks visible matches.

flowchart LR
  A[Search query] --> B[Prepared matcher]
  C[Loaded and recovered messages] --> B
  B --> D[Source text comparison]
  B --> E[Visible text projection]
  E --> F[Prose check or Markdown parser]
  D --> G[Filtered transcript]
  F --> G
  G --> H[Existing highlights]
Loading

Technical review

Best possible solution:

Retain this small optimization in the existing search owners and land it after the required CI gate is resolved.

Do we have a high-confidence way to reproduce the issue?

Current-main source shows repeated query preparation and cold Markdown parsing for ordinary prose; the supplied interleaved browser campaign measures that cost, but this read-only review did not execute a reproduction.

Is this the best way to solve the issue?

The smallest complete optimization skips unnecessary parsing at the existing visible-text owner and shares query preparation within each filter pass while preserving the established matching contract.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against f7d677435070.

Provenance checked

  • Rendered-text projection keeps the original intent (d5be7a6: Match the text readers see while retaining source-only searches and avoiding false visible matches.)
  • Recovered-message and Unicode matching keeps the original intent (c5ee365: Search recovered full replies through their existing recovery owner; the later d53cc8f change preserved canonical Unicode equivalence.)
  • History, Canvas, and pending-input filtering keeps the original intent (03405c3: Search hides presentation without losing input ordering or transcript boundaries; the changed callers preserve their filtering conditions and consume the same prepared predicate.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

Likely related people:

  • Holger Gruenhagen: Raw commit d5be7a6 adds ui/src/components/markdown-visible-text.ts:14 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: d5be7a6a4293; files: ui/src/components/markdown-visible-text.ts)

PR surface

Source +5, Tests +12, Other +2. Total +19 across 6 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 4 63 58 +5
Tests 1 12 0 +12
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 2 0 +2
Total 6 77 58 +19

Review metrics

Metric Value Why it matters
Production versus test growth Production net +5 lines; tests +12 lines The production growth implements the narrow prose check and prepared-query closure; the tests protect whitespace, Unicode folding, and ordered-list behavior without new scaffolding.

Labels

Label changes:

  • add P2: A measured responsiveness improvement to large-conversation search has useful but limited user impact.
  • add proof: sufficient: Contributor real behavior proof is sufficient.
  • add proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence.
  • add rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P2: A measured responsiveness improvement to large-conversation search has useful but limited user impact.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • proof: sufficient: Contributor real behavior proof is sufficient.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed November 1, 2026, 5:41 AM ET / 10:41 UTC.

@steipete
steipete merged commit 3d6ce0f into main Nov 1, 2026
117 of 123 checks passed
@steipete
steipete deleted the solid2/w-perf-transcript-search-1101 branch November 1, 2026 10:48
@steipete

steipete commented Nov 1, 2026

Copy link
Copy Markdown
Contributor Author

Merged via explicitly authorized admin squash with attributed pre-existing CI failures.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 2, 2026
…0238)

Keep formatted-text, source-link, Unicode, and recovered-message search from openclaw#170434 while skipping Markdown parsing for unambiguous prose and preparing each query once per filter pass. Preserve the highlight owner and its viewport lifecycle. Thanks to @holgergruenhagen for the original correctness fix.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui ci:full Keep ordinary native-locale CI selection on the next PR run. P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant