Repository navigation
Description
Current behavior 🐛
Damage regions were meant to make Skia rendering cheaper than 6.5, but on 6.7/6.8 both scrolling and small animations still cost more CPU than 6.5, even with the fixes below. @ramezgerges, this is your area; could you take a look?
Already fixed (open PRs):
- perf(composition): Thread damage clip as bounds, not paths (6.8) #24788 / perf(composition): Thread damage clip as bounds, not paths (6.7) #24789: per-visual
SKPathclip booleans and exact damage paths inVisual.Render. The damage clip is now threaded as a rect. On a scroll, UI-thread render drops 2,374 → 338 ms (6.8) and 2,153 → 355 ms (6.7). - [Skia] SKCanvasElement animations (ProgressRing, AnimatedIcon) damage the whole window every frame on 6.7/6.8 #24790, PRs fix(skia): Bound SKCanvasVisual damage by its size (6.8) #24792 (6.8) / fix(skia): Bound SKCanvasVisual damage by its size (6.7) #24793 (6.7):
SKCanvasVisualdidn't declarePaintsWithinOwnSize, so anyProgressRing/Lottie damaged the whole window every frame. - [Skia/Win32] Accessibility raises a UIA BoundingRectangle event for every moved element on each layout pass #24784 / perf(win32): Stop raising UIA bounds changes on layout #24785–perf(win32): Stop raising UIA bounds changes on layout (6.7) #24787: Win32 UIA
BoundingRectangleevents on every layout move.
What remains (Skia Win32, OpenGL, 250% scale, dotnet-trace sampled thread time):
| Scenario | 6.5.237 | 6.8 + all fixes above |
|---|---|---|
Scroll: ItemsRepeater of 2,837 Fluent Buttons, 12 × 60 × 40 px steps, UI-thread total |
839 ms | 1,270 ms |
of which render walk (Compositor.RenderRootVisual) |
157 ms | 290 ms |
of which layout (UpdateLayout) |
250 ms | 411 ms |
Static page + one ProgressRing, process CPU per 3 s |
~0.6 s | ~1.4 s (noisy machine) |
Observations:
- In the
ProgressRingcase the overlay now shows only the ring's box as damaged, yet CPU is still ~2× 6.5. Before theSKCanvasVisualfix, the hot thread was the Win32 render thread inside native code underCompositionTarget.Draw. CompositionTarget.Drawclips to the damage and then replays the entire frame picture. Hypothesis (unverified): Skia still walks every op in the picture (save/restore/clip for every realized control) even when the clip is tiny. Separately, the UI thread re-walks and re-records the whole tree each frame for a 60 px change.- Master's
2b4457a9ab0(cull off-viewport leaf visuals) isn't on 6.7/6.8. On the scroll, a large share of visuals sits in theItemsRepeatercache buffer outside the viewport, which matches mikernet'sVerticalCacheLengthobservation in Scroll frames pay O(realized visuals) Skia path booleans for damage #23984. - Managed allocation is flat and GC isn't a factor.
Master (Uno.Sdk 7.0.0-dev.17 = ffcff329eb3, 2026-09-25; includes #23986, 74afcfc6d3b, dbb62a5bc4b, 2b4457a9ab0, 0bc538fec5f). Same harness; the app needs SkiaSharp.Views.Uno.WinUI removed to start (see below). Master defaults Win32 to Vulkan, so both renderers were measured:
| Scenario | 6.5.237 | master (Vulkan) | master (OpenGL) | 6.8 + fixes |
|---|---|---|---|---|
| Scroll, process CPU per 60 steps (median, 2 interleaved rounds) | 312 / 297 ms | 297 / 281 ms | 344 / 312 ms | 375 / 578 ms |
TextBlock updated every 16 ms, process CPU per 3 s (3 rounds) |
1,062 / 1,016 / 875 | 1,219 / 766 / 719 | 1,250 / 922 / 1,062 | 1,328 / 1,078 / 734 |
UI-thread split on master for the scroll (sampled, 12 × 60 steps; startup excluded):
| 6.5.237 | master | 6.8 + fixes | |
|---|---|---|---|
| render walk | 157 ms | 224 ms | 290 ms |
| layout | 250 ms | 415 ms | 411 ms |
| Win32 accessibility | 3 ms | 355 ms (fixed by #24785) | 148 ms |
So master is roughly on par with 6.5 in total process CPU for scrolling and simple partial updates. The UI thread still does noticeably more work: layout (+~165 ms, same as 6.8) and accessibility (#24785).
Spinner on master: ProgressRing there renders via generated Composition visuals (d71fa11), not Skottie, so it isn't comparable with 6.x. Its UI-thread render time was 297 ms vs 70 ms on 6.5 (4×), which may be worth a look. Unverified: in a screen capture of the master harness, a TextBlock ticking for 11 s still showed its initial value while CompositionTarget.Rendering kept firing. That could be a presentation or damage under-report on master, or a capture artifact; I couldn't confirm it without intrusive screen captures.
Master harness gotcha: Uno.Sdk 7.0.0-dev.17 implicitly references SkiaSharp.Views.Uno.WinUI 4.151.1, which is built against Uno 5.2 and references the removed Uno.UI.Toolkit. A plain app then hangs silently at startup (no window, no error; FileNotFoundException for Uno.UI.Toolkit inside the generated GlobalStaticResources). Workaround: <PackageReference Remove="SkiaSharp.Views.Uno.WinUI" /> in a target that runs before CollectPackageReferences.
Expected behavior 🎯
With damage regions, a small animation or a scroll should cost no more than on 6.5, ideally less.
How to reproduce it (as minimally and precisely as possible) 🔬
- Skia desktop app on Win32.
ScrollViewer>ItemsRepeater+UniformGridLayout(MinItemWidth=140,MinItemHeight=90), 2,837 items. Template: aButton(140×90) containing aGridwith aFontIconand aTextBlock. - Scroll:
ChangeView(null, i * 40, null, disableAnimation: true)for i = 1..60 withawait Task.Delay(16); measureProcess.TotalProcessorTime. - Animation: overlay a 60×60
ProgressRing IsActive="True", measure CPU over 3 s without scrolling. UseFeatureConfiguration.Rendering.DamageRegionOverlay = trueto see the damage. - Compare Uno.Sdk 6.5.36 against 6.8 with the PRs above.
Workaround 🛠️
Smaller ItemsRepeater.VerticalCacheLength.
Renderer 🎨
- Skia
- Native
Affected platforms 📱💻🖥️
All platforms 🌍
Uno.Sdk version (and other relevant versions) 📦
6.7.22 / 6.8.0-dev.51 plus the PRs above; compared with 6.5.36.
IDE version 🧑💻
No response
Anything else we need to know? 💬
Follow-up of #23984. Harness and traces are available from @MartinZikmund on request.
Activity
agneszitte commentedon Oct 7, 2026
Status update: the 6.8 fixes for this are now available in Uno.Sdk 6.8.0-dev.60:
ProgressRing/ Lottie repaintIn our tests, scrolling and small animations are back to the 6.5 level or better.
Next: once affected users confirm the 6.8-dev build, the same fixes will go into the next 6.7 service release.
cc @mikernet