Repository navigation
trim self-contained builds - #121
Merged
Merged
Conversation
The Store MSIX and the self-contained GitHub zip are published trimmed (partial mode, as WPF doesn't support trimming) and compiled with ReadyToRun: the zip goes from 78.5 to 62 MB, the Store upload from 83 to 63 MB. Without ReadyToRun the trimmed runtime loses its precompiled code and the start takes about 3 times as long; with it the start is as fast as before. The framework-dependent zip is unchanged. What trimming needs here: - H.NotifyIcon kept whole: XAML creates TaskbarIcon through reflection. - Custom resource types and System.Resources.Extensions: AutoUpdater.NET's resources, read on every update check. - COM interfaces kept whole (CoreLib's ComTypes, Microsoft.CSharp, Microsoft.VisualBasic.Core, System.DirectoryServices): the trimmer drops their unused methods, which shifts the vtable slots of the rest, so the Start menu shortcut (IPersistFile) silently wasn't saved. - Built-in COM interop for NAudio and the shortcut code.
…se builds Release publishes no longer carry Volumey.pdb and the WebView2 XML docs, and self-contained ones no longer carry mscordbi, mscordaccore and DiaSymReader, which only serve an attached debugger or dump analysis. The self-contained zip goes from 62.0 to 58.9 MB, the Store upload from 63.2 to 60.1 MB and the framework-dependent zip from 11.9 to 11.5 MB. Crash logs keep their method names but lose line numbers.
Partial trimming keeps every WPF and WinForms assembly whole, including ones the app never uses. The WinForms designer assemblies, VB Forms, the UI Automation client-side providers and the printing assemblies (ReachFramework, System.Printing, PresentationUI) are now trimmed: the self-contained zip goes from 58.9 to 56.2 MB and the Store upload from 60.1 to 57.4 MB. These stay whole: WinForms itself (AutoUpdater.NET's update form names WinForms types in its resources, and a trimmed WinForms crashed it), Ribbon and WindowsFormsIntegration (the XAML loader loads every assembly of the WPF namespace, and a removed Ribbon crashed the start) and the WPF themes (loaded by name). ReachFramework's XPS COM interfaces are kept whole, like the other COM interfaces.
… build The Store build updates through the Store, so the AutoUpdater.NET code is compiled only outside it, and the trimmer drops AutoUpdater.NET and WebView2 from the Store package. Without AutoUpdater.NET's forms nothing uses WinForms there, so WinForms is trimmed in the Store build too (WindowsFormsIntegration, which must stay, keeps a part of it). IMsoComponentManager keeps all its COM methods, like the other COM interfaces. The Store upload goes from 57.4 to 51.9 MB; the GitHub builds are unchanged.
ReadyToRun precompiled every assembly. 40 that the app never loads in normal use (start, mixer, settings pages, OSD, update check) and three big ones it loads at start but barely uses (System.Private.Xml, System.Linq.Expressions, System.Data.Common) are left to compile on first use. The self-contained zip goes from 56.2 to 50.1 MB and the Store upload from 51.9 to 46.7 MB. Measured: the start takes about 12 ms longer (131 to 143 ms to the first idle), the mixer and the settings window open as fast as before, memory is the same.
It's a C++/CLI assembly, which the trimmer can only copy; listing it only made publish warn (IL2106).
…f-contained builds Only Aero2 loads on Windows 10 and 11; AeroLite (high contrast) and Classic (no visual styles) stay. Zip 50.09 -> 49.43 MB.
The settings and the support links only read and write plain JSON. Zip 49.43 -> 49.11 MB, Store upload 45.67 MB with the themes change.
G-Stas
force-pushed
the
feature/trimmed-publish
branch
from
October 28, 2026 00:06
c1abeb8 to
6146889
Compare
G-Stas
marked this pull request as ready for review
October 28, 2026 22:33
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.
Trims the self-contained builds (GitHub zip and Store package) and precompiles them with ReadyToRun.
TrimmerRoots.xml).Sizes: zip 78.5 → 49.1 MB, Store upload 83 → 45.7 MB.