Repository navigation
Description
Track investigation and implementation of spec 023.
Spec: docs/specs/023-perf-insight-tools.md
Problem (short)
A WinUI/XAML developer asking "why is my app slow?" has powerful but disjoint tools (VS Diagnostic Tools, PerfView, WPR+WPA, the 24H2 WPA XAML Frame Analysis plugin, GPUView, EnableFrameRateCounter, Live Visual Tree). None of them speak the developer's language: they report threads, stacks, GC generations, DX queues, and DWM frames, while developers think in XAML elements, bindings, templates, and components. Bridging that gap is left entirely to the human, so most teams ship something that feels slow and depend on one expert who can read an ETL.
Design-time cost is invisible until runtime; runtime cost is unattributable back to design. ETW already gives us a shared clock across kernel/user/native/managed — what is missing is a coherent schema, correlation, and framework-aware attribution on top of it, plus a surface an AI agent can query without parsing .etl files.
High-level options to explore
- Convention layer over ETW (spec's core bet). A universal interval primitive (
System.Diagnostics.Signpost, §9.1), a universal correlation field (IntentId, §7.2), compile-time stable element identity (PerfTag, §9.2), and a compile-time perf report from the XAML compiler (PerfReport.json, §9.3). Bulk of value ships in WinUI / XAML compiler / .NET BCL; Reactor contributes a narrow set of component-layer extensions (§10). - Attribution mechanism (§11) — pick one or blend.
- A.
AsyncLocal<IntentId>— cheap, managed-only, breaks at native/threadpool boundaries. - B. Correlation Vector field on events — crosses managed/native/process boundaries; requires framework cooperation.
- C. Out-of-band sampling + post-hoc attribution — zero framework changes, lossy for short work.
- Spec recommendation: ship A for v1, migrate to B as WinUI formalizes the schema, use C opportunistically.
- A.
- Design-time estimator. v1 lookup table keyed on element-kind × effect-count × repeater-size, seeded by a synthetic workload catalog (§12). v2 real-device telemetry, MetricKit-style (§12.3).
- Agent-first surface.
xamlperfCLI with canonical JSON trace export (§13.1/§13.2) plus optional MCP server (§13.3). Designed for agent consumption from day one, not retrofit. - Responsibility split (§8). Decide which capabilities belong in
microsoft/microsoft-ui-xaml, the XAML compiler, the .NET BCL, vs. Reactor. Default is "WinUI-native unless it provably cannot live there."
Next steps (per spec §17, Phase 0 — 2 weeks)
- Decide attribution mechanism A/B/C via prototype.
- Prototype Signpost API (§9.1) and
PerfTagsynthesis (§9.2) in user-space. - Fix or replace the
EnableFrameRateCounterAV on WinUI 3 Desktop. - Inventory
Microsoft.UI.Xaml.Controls.Perfevents; coordinate with WinUI team on formalizing a subset. - Working minimal overlay against StressPerf grid.
Activity
perf: address PR review findings (behavior-parity hardening + tests)
perf: coalesce COM-interop reads + allocations in reconcile path
perf: address PR review findings (behavior-parity hardening + tests)
azchohfi commentedon Nov 16, 2026
Most of what Reactor owns in this spec has shipped, just not under the names the spec uses.
Spec 023 is mostly a WinUI spec. The Reactor part is §10, and the core of it landed in #1485 and #1491, both in preview.18. Reactor now writes a
Microsoft-UI-Reactor-PerfETW provider that a non-elevated private session can record. That fixes the elevation problem that sank the spec 032 overlay (#507). It has a span for each render pass and each component render, with why the component rendered, which component requested the pass, the reconcile edit counts, and the C# call site when source mapping is on.winapp perfreads it. microsoft/winappCli#837 added recording and analysis and microsoft/winappCli#1300 added the Reactor views.winapp perf analyze <dir> --view componentsranks components by exclusive time with render counts and reasons, and--view hotspotslists slow Reactor passes next to slow frames. Every view has--jsonand winapp ships an agent skill for it, which covers the agent-first goal in §13. #1300 is on winapp main and should go out in the next winapp release.Where §10 stands
ComponentRenderspans carry id, name, reason and call siteRender()as its own cost boundaryThe rest of the spec (Signpost, PerfTag in the XAML compiler, PerfReport.json, the XAML analyzers, the DebugSettings overlay, the dependency graph API, the design-time estimator, MCP and trace compare) is owned by WinUI, the XAML compiler, .NET or winapp per the spec's own §8. None of it is actionable in this repo.
Closing this as done for the Reactor part. The two gaps left in §10 are tracked in #1538.