You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maka.apache.org by "liuxiaocs7 (via GitHub)" <gi...@apache.org> on 2026/09/19 14:21:13 UTC
[PR] perf(ui): incrementally materialize appended transcript turns [maka]
liuxiaocs7 opened a new pull request, #5510:
URL: https://github.com/apache/maka/pull/5510
## Summary
Fixes #5508
A durable message append rebuilt every loaded Turn before deep comparison recovered unchanged identities. Index immutable message snapshots and rematerialize only affected Turns plus connected tool/ShellRun dependencies, reusing the existing materializer in storage order. Replacement, prepend, locale and live-handoff filtering retain the full fallback; value and identity contracts are preserved.
Prefix checks and output-array traversal remain linear. This changes projection work, not the Store, protocol or virtualizer. The patch contains only the implementation and regression tests; measurement scripts and reproduction fixtures are excluded.
## Verification
The historical-read regression failed on the baseline (111 reads) and passes with the fix (0). Differential cases cover cross-Turn ownership, repeated/late results, child-before-parent ShellRun folding, replacement, prepend, filtering, locale, reordering and immutable snapshots.
- UI: 535 tests passed after build; UI typecheck passed.
- Desktop: 2,775 tests passed after build with concurrency 4; all four typecheck configurations passed. An initial default-concurrency run hit the unchanged shell-timeout PID-file race; its 12-test suite and the full bounded-concurrency rerun passed without code changes.
- Full repository build, lint and typecheck passed; Desktop/UI Knip, canonical ASF header and diff checks passed. Formatting passed for all tracked files with repository exclusions respected. `npm run format:check` also sees 11 pre-existing untracked local audit files; those are excluded from this PR and were left unchanged.
### Benchmark results
Apple M4 Pro, macOS arm64 / Darwin 24.6.0, Node v24.14.0; measured 2026-09-19 against `fcc8db89e058b4c2064a9683d6a9f18c2a14ba3b`. The measured candidate source hashes still match `72ea8d279a58a932b304989a1acc78f82d5de8b9` after rebasing onto current main (the intervening upstream change is CLI-only). Both projections ran in the same process with alternating call order and the same frozen snapshots from the real RangeStore. Each Turn starts with user / Read call / text result / assistant; each size gets 20 warmups then 100 consecutive assistant appends. Fixture generation, serialization and correctness assertions are outside the projection timer. p50 averages the middle samples; p95 uses nearest rank.
| Loaded Turns | Before p50 / p95 (ms) | After p50 / p95 (ms) |
| ---: | ---: | ---: |
| 100 | 0.363 / 0.516 | 0.044 / 0.078 |
| 1,000 | 3.702 / 5.284 | 0.124 / 0.202 |
| 5,000 | 20.179 / 28.713 | 0.705 / 0.845 |
| 10,000 | 44.595 / 58.129 | 1.447 / 1.791 |
At 5,000 Turns: **96.5% lower p50, 97.1% lower p95**. A separate untimed work-count probe observed:
| One append to 5,000 Turns | Before | After |
| --- | ---: | ---: |
| Materialized messages | 20,001 | 5 |
| Rebuilt timelines | 5,000 | 1 |
| Unchanged historical timelines rebuilt | 4,999 | 0 |
| Unchanged Turn references preserved | 4,999 | 4,999 |
A temporary real-component browser fixture (ChatView, Composer, ChatSurfaceLayout; production React profiling build; one HeadlessChrome 153 document at 1400 × 900) alternated baseline/candidate roots with 20 warmups and 100 measurements per case:
| 5,000-Turn browser metric | Before p50 / p95 (ms) | After p50 / p95 (ms) |
| --- | ---: | ---: |
| Tail publication → DOM mutation | 19.85 / 23.40 | 5.20 / 6.00 |
| Tail React render (`actualDuration`) | 18.70 / 22.00 | 4.00 / 4.70 |
| Reading history: publication → commit layout effect | 19.70 / 23.70 | 5.20 / 6.50 |
| Append plus input: driver → verified Composer draft | 38.25 / 52.25 | 22.81 / 31.01 |
All unchanged Turn references were preserved; appended text, tail following and input/focus were verified. The reading anchor stayed within 1 px (observed 0 px). Input used CDP `Input.insertText`; that timing includes driver/protocol and verification overhead, not native OS input latency or INP. The browser fixture excludes Electron/Host/IPC. React render includes projection, so the two are not additive. Layout and sampled frame gaps were similar; no frame-rate or GC improvement is claimed. There is no wall-clock CI threshold.
## AI use
- [ ] No generative tool made a substantive contribution
- [x] Generative tooling made a substantive contribution
Tool(s) and scope: Codex assisted with diagnosis, implementation, regression tests, local measurements and this issue/PR submission at @liuxiaocs7's request. The commit includes `Generated-by: Codex`.
## Checklist
- [x] Tests cover the change and fail without it
- [x] Lint, format, typecheck and the affected suites pass locally
Does this PR entail a change in behavior?
- [ ] Yes — described under Summary above
- [x] No
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For additional commands, e-mail: commits-help@maka.apache.org
Re: [PR] perf(ui): incrementally materialize appended transcript turns [maka]
Posted by "liuxiaocs7 (via GitHub)" <gi...@apache.org>.
liuxiaocs7 commented on PR #5510:
URL: https://github.com/apache/maka/pull/5510#issuecomment-5812053158
Thanks @Astro-Han for reviewing!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For additional commands, e-mail: commits-help@maka.apache.org
Re: [PR] perf(ui): incrementally materialize appended transcript turns [maka]
Posted by "liuxiaocs7 (via GitHub)" <gi...@apache.org>.
liuxiaocs7 merged PR #5510:
URL: https://github.com/apache/maka/pull/5510
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For additional commands, e-mail: commits-help@maka.apache.org