Repository navigation
perf(trimming): Require a constructor for linker hint availability - #26054
Closed
MartinZikmund wants to merge 2 commits into
Closed
MartinZikmund wants to merge 2 commits into
MartinZikmund wants to merge 2 commits into
Conversation
A DependencyObject type counted as available whenever its TypeDef survived a linker pass, which any `is` check or field type is enough for. The bindable metadata then constructed it and kept its whole implementation: in a blank app RichEditBox (with its RTF codec and System.Text.Encoding.CodePages), TextBox, ComboBox and ~110 others. Concrete types now need a kept instance constructor. Blank WebAssembly app with UnoXamlResourcesTrimming: -822 KB brotli (Uno.UI -462 KB). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TXMNu2RupRy4QPFGK2cmij
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TXMNu2RupRy4QPFGK2cmij
Contributor
|
🤖 Your WebAssembly Sample App stage site is ready! Visit it here: |
This was referenced Nov 4, 2026
Member
Author
|
Heads-up: with this change, an |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
GitHub Issue: closes #26048
PR Type:
🐞 Bugfix
What changed? 🚀
With
UnoXamlResourcesTrimming,LinkerHintGeneratorTaskcounted aDependencyObjecttype as available whenever its TypeDef survived a linker pass. Anischeck is enough for that. The bindable metadata then constructed the type and kept its whole implementation: in a blank app, RichEditBox (with its RTF codec andSystem.Text.Encoding.CodePages) and ~110 other controls nothing creates.A concrete type now also needs a kept instance constructor. Abstract types keep counting, so their derived types' hints still hold. Controls instantiated by kept XAML still converge through the existing fixed-point passes.
Blank
unoapp, WebAssembly Release, trimming on, brotli: −822 KB (Uno.UI −462 KB, CodePages −173 KB gone, FluentTheme −114 KB, Xml −42 KB).Validation:
Given_LinkerHintGeneratorTask(4).Measurements
Size detail on the earlier base (blank app): Uno.UI −462 KB, System.Text.Encoding.CodePages −173 KB (gone), Uno.UI.FluentTheme −114 KB, System.Private.Xml(.Linq) −42 KB. A 20-control page: −600 KB.
How this was measured
Blank
dotnet new unoapp(Skia,net10.0-browserwasm, Release publish), built twice from the same tree: with all six startup PRs (#26054–#26059) plusUnoXamlResourcesTrimming, and with only this PR's change removed. Both builds were served by the same static server (brotli q11, immutable caching for fingerprinted files) and loaded cold in headless Chrome, runs interleaved. "Visually ready" is the first CDP screencast frame identical to the settled final frame. 4G = 9 Mbps down, 85 ms RTT (CDP emulation). Values are medians with (min–max). A difference is only claimed where the ranges don't overlap. Rig: Playwright + Node, available on request.PR Checklist ✅
Screenshots Compare Test Runresults.Apps that create controls only through
XamlReaderwith trimming on were already unsupported (see the resources-trimming docs). This change makes "only type-checked" controls fall in the same bucket.🤖 Generated with Claude Code
https://claude.ai/code/session_01TXMNu2RupRy4QPFGK2cmij