Visitar URL original
perf: Trim the package manifest parser when no manifest is embedded by MartinZikmund · Pull Request #26058 · unoplatform/uno · GitHub
Skip to content

perf: Trim the package manifest parser when no manifest is embedded - #26058

Draft
MartinZikmund wants to merge 1 commit into
masterfrom
dev/mazi/trim-manifest-parser
Draft

MartinZikmund wants to merge 1 commit into
masterfrom
dev/mazi/trim-manifest-parser

Conversation

@MartinZikmund

@MartinZikmund MartinZikmund commented Nov 4, 2026 •

Copy link
Copy Markdown
Member

GitHub Issue: closes #26052

PR Type:

✨ Feature

What changed? 🚀

Package.ParsePackageManifest uses XmlDocument and XPath, which keeps System.Private.Xml in every trimmed app, even WebAssembly heads that embed no manifest and therefore never parse one.

The parser now sits behind a [FeatureSwitchDefinition("Uno.ApplicationModel.Package.IsManifestEmbedded")] switch. Heads without an embedded Package.appxmanifest turn it off (RuntimeHostConfigurationOption, Trim="true"). Heads that embed one (desktop) are unchanged.

Blank WebAssembly app: −150 KB brotli (System.Private.Xml removed, CoreLib −9 KB).

Validation:

  • Publish: System.Private.Xml.wasm no longer shipped.
  • Runtime: blank app pixel-identical. Package behavior on WASM is unchanged, since no manifest was embedded before either.

Measurements

Without this PR With this PR Δ
Download (brotli) 6.57 MB 6.42 MB −150 KB
4G visually ready 7094 ms (7087–7108) 6945 ms (6925–6966) −149 ms (−2.1%)
Local visually ready 871 ms (862–898) 856 ms (849–882) within noise

Measured on adjacent builds: the same tree just before and just after this commit.

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) plus UnoXamlResourcesTrimming, and with this PR's change removed (adjacent builds). 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 ✅

  • 🧪 Added Runtime tests, UI tests, or a manual test sample (for bug fixes / features, if applicable)
  • 📚 Docs have been added/updated following the documentation template (for bug fixes / features)
  • 🖼️ Validated PR Screenshots Compare Test Run results.
  • ❗ Contains NO breaking changes
  • 👀 Reviewed 2 other open pull requests (optional but appreciated!)

🤖 Generated with Claude Code

https://claude.ai/code/session_01TXMNu2RupRy4QPFGK2cmij

Package parses an embedded Package.appxmanifest with XmlDocument and
XPath, which keeps System.Private.Xml in every trimmed app even where
no manifest is embedded (WebAssembly heads), so the parse never runs.
Heads without one now turn the parser off through a feature switch:
-150 KB brotli on a blank WebAssembly app.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TXMNu2RupRy4QPFGK2cmij
@github-actions github-actions Bot added the area/code-generation Categorizes an issue or PR as relevant to code generation label Nov 4, 2026
@unodevops

Copy link
Copy Markdown
Contributor

🤖 Your WebAssembly Sample App stage site is ready! Visit it here:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/code-generation Categorizes an issue or PR as relevant to code generation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Trimmed apps keep System.Private.Xml for an appxmanifest they do not embed

2 participants