Repository navigation
Description
Current behavior 🐛
On Android, cold start is ~0.6 s slower on 7.0 than on 6.7 Skia: the first frame comes at 2,652 ms vs ~1,930 ms. Measured on a Pixel Tablet, Release, 7.0.0-dev.2275.
The extra time is all between the first page's InitializeComponent and Loaded.
- It's not the render backend: Vulkan and OpenGL start within ~20 ms of each other.
- It's not JIT: full AOT shows the same gap.
Root cause: until the first frame, the UI dispatcher runs about one queued item per vsync.
ApplicationActivityarms a first-frame gate.NativeWindowWrapper.ActivationPreDrawListener.OnPreDrawreturnsfalseuntil a Skia frame has been presented.- Each
falsemakesViewRootImplcancel the draw and callscheduleTraversals()again, which posts a sync barrier every vsync. NativeDispatcher.Androidposts throughnew Handler(Looper.MainLooper), so its messages are synchronous and wait behind that barrier.DispatchItemsruns one queue item per message.
Startup is a chain of await continuations on the dispatcher's SynchronizationContext:
- the font preload: 36 OpenSans faces plus the symbols font, each completing exactly 16.6 ms after the previous one, all on the UI thread;
- then the page and
Loaded.
So the first frame waits on work that is itself throttled by waiting for the first frame.
Expected behavior 🎯
Dispatcher work runs at full speed while the window's first draw is held back.
How to reproduce it (as minimally and precisely as possible) 🔬
- Create a blank
unoapptargeting Android. - Launch it twice; on the first launch the fonts aren't extracted yet, so it hides the issue.
- On the second and later cold launches, compare the time to the first
CompositionTarget.RenderingafterLoaded:- stock, against
- a build where
NativeDispatcher.AndroidusesHandler.CreateAsync(Looper.MainLooper).
Measured on a patched dev.2275 (6 interleaved cold starts each, ms after process start):
Loaded |
First frame | |
|---|---|---|
| Stock | 2,122 | 2,652 [2,643..2,677] |
| Async dispatcher handler | 1,538 | 2,070 [2,051..2,087] |
Runtime throughput (rapid element creation, LOLs, scripted scrolling) is unchanged within noise.
Workaround 🛠️
None from app code.
Affected platforms 📱💻🖥️
Android
Uno.Sdk version (and other relevant versions) 📦
7.0.0-dev.2275
IDE version 🧑💻
N/A
Anything else we need to know? 💬
The first-frame gate was added in July 2026, so 6.7 doesn't have the throttle.
Async messages bypass sync barriers; that's what Choreographer and input already use. Posting the dispatcher's messages that way keeps the gate and removes the throttle.
Activity
perf(android): Post dispatcher work as async messages