Skip to content

Reduce chat rendering work and adopt upstream widget fixes - #85

Merged
ymote merged 20 commits into
mainfrom
perf/widget-update-guards
Oct 9, 2026
Merged

ymote merged 20 commits into
mainfrom
perf/widget-update-guards

Conversation

@ymote

@ymote ymote commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Chat scrolling and typing performed avoidable widget work, and mobile messages first constructed an unused desktop child tree. This change builds only the mobile message body, removes redundant backgrounds and scroll-action traversal, and uses a direct pointer-routing setter instead of script reapplication. Ordinary touch drags scroll; long presses and selection-handle drags select text. Timeline images opt into decoding at their displayed size.

Pin Makepad to 07825feab from OctoSense-org/makepad#112. That dependency includes Android scheduling/fling fixes, discrete caret blinking, bounded widget-cost attribution, and official upstream navigation/IME and image backports. It also clears stale PortalList drag state when a child takes pointer capture, preserving selection controls from Rinx #86 / Makepad fork #114 and allowing existing overscroll to settle.

Merge the Makepad dependency first, preserving the tested pinned commit in its main history.

Validation

Exact tested revisions: Rinx 297903d1043023d8992136a0e622fdf92df82795, Makepad 07825feab684d21f69b4afb1ec60f623c13f9183.

Test Baseline Candidate
Hidden native Metal: median callbacks / 8 s focused idle 207 13
Hidden native Metal: callbacks / 20 s typing/deletion 539 87
Mate 70 Air: median callbacks / 8 s focused idle 69 17
Mate 70 Air: callbacks / 20 s typing/deletion 156 48
Mate 70 Air: presentation intervals >25 ms, 12 native swipes 35/1,784 (1.96%) 26/1,781 (1.46%)

The signed HarmonyOS release packages ran on Mate 70 Air (SUP-AL90, API 24, 60 Hz). Candidate median/p95 presentation intervals were 16.622/16.665 ms, maximum 33.294 ms. The baseline includes one unresolved 1,047 ms first-interval gap (swipe setup versus app latency), retained in raw totals. These small samples do not establish a robust scrolling speedup.

macOS and HarmonyOS used an isolated 160-message Matrix fixture; typing inserted and deleted an unsent draft. The final instrument-only and native-swipe protocols passed, with no messages sent. Phone scrolling used native touch injection, profiling disabled, and RenderService timestamps for the owned surface. Native drawable captures verified rendering. Invalid USB-input and stale-history trials were excluded. Detailed captures/reports remain local; owned test sessions are closed.

Redmi Note 12 final release: long-press and handle-drag selection extends through wrapped text without moving the conversation. Focused idle recorded 1.91 presents/s versus the earlier baseline's 8.70/s. With profiling off, 24 gestures recorded 7/2,281 missed refresh opportunities (0.307%), max 33.421 ms; a same-session previous-build control recorded 7/2,252 (0.311%). No additional scrolling gain is established by that comparison. Current-head OnePlus runtime validation is not claimed.

Rinx CI passes all three checks; release unit tests record 355 passed, 0 failed, 2 existing ignores. Makepad widget tests record 292 passed and three failures also reproduced on the baseline: desktop_style::tests::mobile_typefaces_keep_symbol_fallbacks_across_appearances, widget_tree::tests::test_observe_and_find_single_node, and widget_tree::tests::test_property_patch_no_structural_rebuild. Widget compile checks pass on macOS, Android, Wasm, Linux, Windows, and OpenHarmony using installed SDKs. Existing warnings remain; iOS is untested because its Rust target is absent. Draw/platform suites passed 151/252 tests on the integrated parent; the final Makepad change is limited to PortalList. These are compile/unit results, not six-platform runtime claims.

Remaining limits

This is not a hitch-free, battery-saving, memory-leak, or native-app-parity claim. Cold room opening (about 276 ms in the earlier Android capture), safe cross-message rich-text recycling, gradual memory growth, and startup-theme persistence remain unresolved. Image-memory savings were not quantified.

Hidden macOS windows use timer pacing, so those results establish callback work, not display frame rate or physical input latency. Profiler-off scroll CPU medians were 0.99 -> 0.90 seconds in small runs under background load; no causal gain is claimed. Combined typing/scroll captures had glyph artifacts in both revisions; separate scroll-only captures rendered correctly, leaving visible-window follow-up.

The OHOS painted-frame counter remains unwired and was not used. Mobile chat children are missing from widget inspection, so native-image checks validated the composer outside timing intervals. The local fixture does not establish performance against a live encrypted server or under sustained thermal load.

@ymote ymote changed the title Skip redundant Makepad updates and export widget cost diagnostics Reduce Android chat scrolling hitches and redundant rendering work Oct 9, 2026
ymote added 4 commits October 8, 2026 20:42
Use a child-free Message type default, instantiate each mobile body once, and opt timeline images into display-sized decoding. Pick up the upstream navigation/image backports and discrete caret blink from Makepad ace2e5033.
@ymote ymote changed the title Reduce Android chat scrolling hitches and redundant rendering work Reduce Android chat rendering work and adopt upstream widget fixes Oct 9, 2026
@ymote ymote changed the title Reduce Android chat rendering work and adopt upstream widget fixes Reduce chat rendering work and adopt upstream widget fixes Oct 9, 2026
@ymote
ymote marked this pull request as ready for review October 9, 2026 21:00
@ymote
ymote merged commit ad6ed96 into main Oct 9, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant