Repository navigation
feat(perf2026): Opt-in WinUI Perf2026 optimizations via XamlOptionalChanges - #24094
morning4coffe-dev wants to merge 6 commits into
Conversation
|
Claude finished @morning4coffe-dev's task in 10m 29s —— View job PR Review: perf: port WinUI Perf2026 optimizationsTasks
Overall Verdict: fix-first on three minor items; architecture and test coverage are excellentThe PR is a high-quality, well-structured port. The allocation wins are real and well-measured, the opt-in design is clean, and the test suite is thorough (unit tests for every changed hot path, new runtime tests, new generator snapshots). The findings below are all correctable before merge. Issues by SeverityMedium — 3 findings (all on the same pattern)
In all three cases, Low — 1 finding
Low / Code Clarity
Cross-cutting ObservationsTemplateBinding fast path — design is correct: the DependencyObjectCollection InlineArray — the
|
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-24094/wasm-skia-net9/index.html |
|
🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-24094/docs/index.html |
|
The build 228103 found UI Test snapshots differences: Details
|
|
Claude finished @morning4coffe-dev's task in 4m 43s —— View job PR Review: perf: port WinUI Perf2026 optimizationsTasks
Overall Verdict: ship — all prior findings addressed, no new blocking issuesThe Previous Findings — All Resolved ✅
Remaining Observations (non-blocking)Low / test coverage gap A snapshot test for Low / cosmetic (CodeQL, no behavioral impact)
Code Quality Observations (cross-cutting, unchanged from first pass)The overall quality of this PR remains high:
|
|
Claude finished @morning4coffe-dev's task in 3m 36s —— View job PR Review: perf: port WinUI Perf2026 optimizationsTasks
Overall Verdict: ship — all prior gaps closed, new commits cleanThe four commits added since the second review pass cleanly address everything that was open:
No new findings. No inline comments to post. Verification of the attached-property target snapshot (
|
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-24094/wasm-skia-net9/index.html |
|
🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-24094/docs/index.html |
|
The build 229951 found UI Test snapshots differences: Details
|
|
Claude finished @morning4coffe-dev's task in 2m 30s —— View job PR Review: perf: port WinUI Perf2026 optimizationsTasks
Overall Verdict: ship — new commits are clean, one remaining nitThe three commits added since the third review pass are all mechanical:
No new correctness issues found. One Remaining Nit (non-blocking)
Prior Findings — All Resolved ✅All findings from reviews 1 and 2 were resolved in Screenshot diffs (57 Skia Linux, 2348 Skia Windows, 11 WASM) remain open for the author to validate visually — the high Skia Windows count is expected given the control-style and icon-layout changes in this PR, but the author should confirm baselines are acceptable before merge. |
|
🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-24094/docs/index.html |
|
🤖 Your WebAssembly Sample App stage site is ready! Visit it here: |
|
The build 247267 found UI Test snapshots differences: Details
|
Optimized Fluent styles, deferred overridden setter values and grid-less FontIcon/BitmapIcon. Co-Authored-By: Martin Zikmund <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01TXMNu1LMuUpziGZWHVDmpX
Co-Authored-By: Martin Zikmund <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01TXMNu1LMuUpziGZWHVDmpX
Implements Microsoft.UI.Xaml.Settings.XamlOptionalChanges, locked when Application.Start runs, and drives the Perf2026 optimizations from it instead of the FeatureConfiguration.Perf2026 switches. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01TXMNu1LMuUpziGZWHVDmpX
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01TXMNu1LMuUpziGZWHVDmpX
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01TXMNu1LMuUpziGZWHVDmpX
1374048 to
3dec232
Compare
|
Claude finished @MartinZikmund's task in 18s —— View job PR Review: perf: port WinUI Perf2026 optimizations (eleventh pass)Verdict: ship, with description cleanup. There are no inline findings. Scope and limits: this was a read-only pass. I didn't build or run tests. The Checked
Non-blocking
|
WinAppSDK sync generator drift detected on
|
There was a problem hiding this comment.
🔵 Needs a closer look
Human runtime review is needed because the PR combines global gating, deferred styles, resource overlays, and numerous Fluent template changes whose cross-platform theme, visual-state, and accessibility behavior cannot be fully validated statically.
No open issues 🎉
4 resolved since last review
The allocation test assertion is inverted: `Assert.IsLessThan(inverseAllocations / 10,… Empty indexers are required to become integer index0, but returningfalseclassifiesItems[]…ConcurrentDictionarycannot store a null value. When the requested{Name}Propertymember does… This change modifies a checked-in file undersrc/Uno.UI/Generated/.... In this repo, files under…
Review effort: Lite
Uno now has perf2026 style variants under Uno.UI.FluentTheme/Perf2026, so the port prompt no longer lists `*_perf2026*` changes as Not applicable. A change is ported when the area maps the Uno copy, and recorded as Skipped otherwise, so new upstream variants surface. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01TXMNtzDYsFtkCZh1wz4Lkf
|
Claude finished @MartinZikmund's task in 18s —— View job PR Review: opt-in Perf2026 via
|
8594681 to
dfe419a
Compare
|
Claude finished @MartinZikmund's task in 32s —— View job PR Review: opt-in Perf2026 via
|
|
Tick the box to add this pull request to the merge queue (same as
|
| // The setter may resolve resources, which must happen in the scope the Style was declared in, | ||
| // exactly as it would have during ApplyTo. This matters for deferred setters, whose value is | ||
| // only built when this method is reached through DependencyObject.ReevaluateBaseValue. | ||
| ResourceResolver.PushNewScope(_xamlScope); |
There was a problem hiding this comment.
TryGetPropertyValue now pushes/pops a resource scope on every call, even with all XamlChangeIds off. It's reached from FrameworkElement.mux.cs:56 and Control.mux.cs:244 (the property-value lookup path), so this is an always-on cost and a behavior change, which conflicts with the PR's "allocation-neutral with switches off" claim.
Consider pushing the scope only when setter is a deferred, not-yet-materialized setter, or when IsOptimizeApplyStylesEnabled is true. Otherwise keep the previous direct call. Either way, please confirm via the benchmark that the flag-off path isn't regressed.
WinAppSDK sync generator drift detected on
|
WinAppSDK sync generator drift detected on
|



GitHub Issue: closes #24093
PR Type:
✨ Feature
What changed? 🚀
Note
Stacked on #26583: the optimized ComboBox style relies on its
ComboBoxHelperport. Once #26583 merges, GitHub retargets this PR tomaster.This PR ports the opt-in part of WinUI 3's 2026 performance work (
WinUI 3 Performance: A Leap Forward): the changes that can alter visual tree shapes or style evaluation order, and that WinUI therefore keeps behindMicrosoft.UI.Xaml.Settings.XamlOptionalChanges.The always-on optimizations originally in this PR are now separate PRs, so each can be reviewed and reverted on its own:
TemplateBindingfast pathPropertyPathParserport (+propertypathsync area)DependencyObjectCollectionsSystem.Threading.Lock+ frozen ARIA role tableComboBoxHelper.KeepInteriorCornersSquare(not perf, but used by the default ComboBox style)Opting in:
XamlOptionalChangesUno now implements WinUI's
XamlOptionalChanges(until now a[NotImplemented]stub from the API sync) instead of Uno-specificFeatureConfigurationswitches. TheFeatureConfiguration.Perf2026switches never shipped, so dropping them breaks nobody.As in WinUI,
Application.Startlocks the set (WinUI does it inDXamlCore::InitializeImpl), after whichEnableChange/DisableChangethrowInvalidOperationException(WinUI'sE_ILLEGAL_STATE_CHANGE). Unknown IDs are ignored before the lock. Ported fromXamlOptionalChanges_Partial.cppandOptionalChangeState.hat WinUI 2.7.0. Not ported: WinAppSDK's containment gate (a Windows servicing kill switch).XamlChangeIdDefaultStyleOptimizationsObjectAnimationUsingKeyFramesstoryboards becomeVisualState.Setters, and there are fewer resource lookups.OptimizeApplyStylesOptimizedStylesetter values (0ae9b9a7).IconNoGridOptimizationFontIcon/BitmapIconhost theirTextBlock/Imagedirectly, without the transparentGrid(2 objects and 1 layout/render level fewer per icon; 16737fe3).ImageIcon.OnApplyTemplateaccepts either shape, as upstream does.DeferContextFlyoutInitRuntime tests flip changes through an internal
XamlOptionalChanges.SetChangeEnabledForTestinghook, the counterpart of WinUI'sResetOptionalChangestest hook.WinUI port sync
perf2026area at WinUI 2.7.0: the eight*_themeresources_perf2026.xamlstyle ports plusXamlOptionalChanges.NavigationBackButton_perf2026.xamlandTabView_perf2026.xamljoin the existingnavigationview/tabviewareas.main, 55f99cde), so they get tracked once a stable tag has them.build/winui-sync/prompt.md) no longer lists*_perf2026*variants as Not applicable, since Uno now has them: a change is ported when the area maps the Uno copy, and recorded as Skipped otherwise. The/winui-sync-onboardskill says where the variants live and which area maps them.Validation
Uno.UI.UnitTests(net11.0, transitively Uno.UI and Uno.UI.FluentTheme) and SamplesApp (net11.0-desktop).Given_XamlOptionalChanges4/4 (defaults, enable/disable, unknown IDs, lock) andWindows_UI_Xaml.Given_Style14/14.Given_DefaultStyleOptimizations,Given_IconElement_NoGridContainer,Given_Style,Given_ButtonandGiven_ComboBox: 105 passed, 1 failed, 3 skipped. The failure,Given_ComboBox.When_ComboBox_MinWidth(169.33 vs 170), is the known fractional-DPI rounding issue at this machine's 150% scale and also fails onmaster.detect.ps1reportsperf2026,navigationviewandtabviewup to date. Tooling tests 133/133.Performance
Headless Skia app with Fluent resources (x64, net10.0,
DOTNET_TieredCompilation=0), one process per scenario, 4 interleaved A/B rounds against #26583 (this PR's base). Allocations are UI-thread bytes and exact: amaster-vs-masternull run drifted 0.00%. A time change is bold only when it is larger than that scenario's null drift and the A/B ranges don't overlap; anything else is marked noise. Background load on the machine made some timings noisy.FontIcon/BitmapIconButtons, built + laid outTagset/getFontIcon/BitmapIcon— switches onButtons, built + laid out — switches onButtons with local values overriding the style — switches onComboBoxes, built + laid out — switches onWith the switches off, this PR is allocation-neutral apart from a −713 B saving per icon from the reworked
BitmapIcon/FontIconcode (the +109 B per Button is a +0.09% difference). With all threeXamlChangeIds on:IconNoGridOptimizationremoves 7.3 KB per icon (−28%) and makes the icon scenario 38% faster.DefaultStyleOptimizationssaves about 10.6 KB per control on the mixed page and 78 B per visual-state change.OptimizeApplyStylessaves about 700 B per Button whose style values are overridden locally.The large Button win belongs to #26584, which is why it doesn't appear here.
PR Checklist ✅
Screenshots Compare Test Runresults.🤖 Generated with Claude Code
https://claude.ai/code/session_01TXMNu1LMuUpziGZWHVDmpX