Repository navigation
perf(wasm): Trim the script copies embedded in runtime assemblies - #26057
Draft
MartinZikmund wants to merge 1 commit into
Draft
MartinZikmund wants to merge 1 commit into
MartinZikmund wants to merge 1 commit into
Conversation
Uno.Wasm.Bootstrap extracts each assembly's WasmScripts/WasmCSS into the app's package folder at build time and the app loads those files, but the trimmed assemblies still carried the embedded copies: the browser runtime's 425 KB Uno.Runtime.Wasm.js and Uno.WinRT's Uno.Wasm.js, so every app downloaded them twice. Linker substitutions now remove them: -81 KB brotli on a blank app. 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 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 #26051
PR Type:
🐞 Bugfix
What changed? 🚀
Uno.Wasm.Bootstrap extracts each assembly's
WasmScripts/WasmCSSinto the app's package folder at build time (from the pre-link reference assemblies), and the app loads those files. The trimmed assemblies still carried the embedded copies, soUno.Runtime.Wasm.js(425 KB) andUno.Wasm.js(157 KB) were downloaded twice.Both projects now add an ILLink substitution that removes these resources from the linked output: −81 KB brotli (Runtime.WebAssembly.Browser −58 KB, WinRT −23 KB).
Validation:
package_*.Measurements
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.🤖 Generated with Claude Code
https://claude.ai/code/session_01TXMNu2RupRy4QPFGK2cmij