Repository navigation
perf(android): Post dispatcher work as async messages - #25487
Conversation
|
Claude finished @MartinZikmund's task in 18s —— View job Review of #25487Verdict: ship (with one optional nit). Issues: 0 high, 0 medium, 1 low (inline). Cross-cutting notes
|
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-25487/wasm-skia-net9/index.html |
|
Claude finished @MartinZikmund's task in 11s —— View job Review of #25487 (re-review after the latest push)Verdict: ship. Issues: 0 high, 0 medium, 0 low.
|
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-25487/wasm-skia-net9/index.html |
|
The build 239541 found UI Test snapshots differences: Details
|
|
|
The first-frame gate's OnPreDraw returns false until a Skia frame is presented, so the view system posts a sync barrier every vsync. The dispatcher's synchronous messages waited behind it, running one item per frame until the first frame: ~0.6 s of cold start (fixes #25486). Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01NL1zD4nmcDjrcPhceNXFNm
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01NL1zD4nmcDjrcPhceNXFNm
1d897b4 to
f7d4bde
Compare
|
Claude finished @ajpinedam's task in 12s —— View job Review of #25487 (re-review after the latest push)Verdict: ship. Issues: 0 high, 0 medium, 0 low. I posted no inline comments.
|
|
🤖 Your WebAssembly Sample App stage site is ready! Visit it here: |
|
The build 241732 found UI Test snapshots differences: Details
|
|
This pull request does not currently match the merge queue conditions, so it cannot be queued from here. The box comes back if it matches again. |
The Android adapter records most events from a synchronous main-looper message, which the view system's sync barriers can hold back. Since unoplatform#25487 the dispatcher posts asynchronous messages that skip those barriers, so WaitForIdle can return before the record exists, and these tests failed intermittently on every Android lane. They now poll for the expected record, and the background-thread action test waits for its click. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
GitHub Issue: closes #25486
PR Type:
🐞 Bugfix
What changed? 🚀
NativeDispatcher.Androidnow posts its work as asynchronous main-looper messages:Handler.CreateAsyncon API 28+;Message.Asynchronous = truebelow that.Before: the messages were synchronous, so they waited behind the view system's sync barriers.
Why it mattered: until the first Skia frame, the first-frame gate's
OnPreDrawreturnsfalse. EachfalsemakesViewRootImplreschedule its traversal and post a sync barrier every vsync.DispatchItemsruns one item per message, so until the first frame the dispatcher ran one item per vsync. Startup awaits a long chain of dispatcher continuations: the font preload's 36 faces, then the page andLoaded. The first frame waited on work that was itself throttled by waiting for the first frame. Choreographer and input already use async messages for the same reason.Measured on a Pixel Tablet, Release, dev.2275 with this change behind a switch. 6 interleaved cold starts each, ms after process start:
LoadedValidation:
Uno.UI.Dispatching.netcoremobile(net10.0-android), with analyzers.Messagefallback.No automated test: the runtime tests build as generic
net10.0and can't install a nativeOnPreDrawListenerto recreate the sync barrier.PR Checklist ✅
Screenshots Compare Test Runresults.🤖 Generated with Claude Code
https://claude.ai/code/session_01NL1zD4nmcDjrcPhceNXFNm