avalonia-performance
Installation
SKILL.md
Avalonia Performance & Diagnostics
Version labels follow avalonia-versions: (12.0+), (12.1+), (11.x), no label = 11.3/12.0/12.1. For publish steps (RIDs, single file, installers) see avalonia-deployment; this skill covers only the performance-relevant flags.
Workflow
- Measure first: overlay FPS/layout/render graphs, then DevTools visual tree, then
dotnet-counters/dotnet-trace. - Fix the biggest cost: usually (a) non-virtualized big list, (b) reflection bindings, (c) full-size image decode, (d) deep/huge visual tree, (e) work on the UI thread.
- Re-measure in Release (
dotnet run -c Release); Debug builds and an attached debugger distort results.
Diagnosing
DevTools
| Package | Call | |
|---|---|---|
| (12.0+) | AvaloniaUI.DiagnosticsSupport (+ AvaloniaUI.DeveloperTools global tool avdt, Avalonia Plus tooling) |
this.AttachDeveloperTools(); in Application.Initialize() |
| (11.x) | Avalonia.Diagnostics |
this.AttachDevTools(); (or window.AttachDevTools()) |