Skip to content

trim self-contained builds - #121

Merged
G-Stas merged 9 commits into
mainfrom
feature/trimmed-publish
Oct 28, 2026
Merged

G-Stas merged 9 commits into
mainfrom
feature/trimmed-publish

Conversation

@G-Stas

@G-Stas G-Stas commented Oct 27, 2026 •

Copy link
Copy Markdown
Owner

Trims the self-contained builds (GitHub zip and Store package) and precompiles them with ReadyToRun.

  • Partial trimming; ReadyToRun only for the DLLs the app loads, so start-up stays as fast as before.
  • Keeps what the trimmer would break: the tray icon library, the updater dialog's resources, and COM interfaces (TrimmerRoots.xml).
  • Release builds leave out symbols, XML docs and the runtime's debugger files.
  • The Store build leaves out AutoUpdater.NET, WebView2 and most of WinForms (the Store updates the app).
  • Leaves out the WPF themes of older Windows and the Fluent theme, and trims Newtonsoft.Json.

Sizes: zip 78.5 → 49.1 MB, Store upload 83 → 45.7 MB.

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
G-Stas force-pushed the feature/trimmed-publish branch from c1abeb8 to 6146889 Compare October 28, 2026 00:06
@G-Stas
G-Stas marked this pull request as ready for review October 28, 2026 22:33
@G-Stas
G-Stas merged commit fdb9af0 into main Oct 28, 2026
3 checks passed
@G-Stas
G-Stas deleted the feature/trimmed-publish branch November 3, 2026 19:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant