Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Core Managed libraries size-reduction for WebAssembly #44530

Closed
8 of 17 tasks
CoffeeFlux opened this issue Nov 11, 2020 · 3 comments
Closed
8 of 17 tasks

Core Managed libraries size-reduction for WebAssembly #44530

CoffeeFlux opened this issue Nov 11, 2020 · 3 comments
Assignees
Labels
arch-wasm WebAssembly architecture area-Meta size-reduction Issues impacting final app size primary for size sensitive workloads tracking This issue is tracking the completion of other related issues.
Milestone

Comments

@CoffeeFlux
Copy link
Contributor

CoffeeFlux commented Nov 11, 2020

Libraries code reduction:

In order to produce a minimally-sized Blazor wasm sample, we will have to also shrink the size of the managed libraries. Current Brotli-compressed sizes indicate that the bulk of our size budget is taken up by four assemblies:

  • System.Private.CoreLib (403KB)
  • System.Text.Json (78KB)
  • System.Net.Http (53KB)
  • Microsoft.AspNetCore.Components (45KB)

Every other assembly is around 25KB or lower.

Additionally, all the non-Corelib libraries combined are only barely larger than Corelib itself, and there is no way to get around loading Corelib early in startup. Any work to shrink Corelib will help with native size reduction as well, once we are able to fully link out unused P/Invokes. Given that we have a 0.5MB budget for the entire initial wire transfer and the linked Corelib is around 0.4MB, this effort has no chance of succeeding without a dramatically smaller Corelib. Additional efforts may be necessary, so feel free to add issues to the list, but this should be a good start.

It's worth noting that flags to disable features entirely in the interest of size reduction are very welcome here. The goal is to get the initial wire size as small as possible, and that can mean sacrifices in functionality.

Some of the source generator work is more speculative on the overall size, but it should enable us to trim more code out from Corelib. If we can delay loading of the generated assemblies, it could be a large win.

.NET 6.0.0 :

Future release :

@CoffeeFlux CoffeeFlux added arch-wasm WebAssembly architecture area-Meta tracking This issue is tracking the completion of other related issues. labels Nov 11, 2020
@CoffeeFlux CoffeeFlux added this to the 6.0.0 milestone Nov 11, 2020
@eerhardt eerhardt added the linkable-framework Issues associated with delivering a linker friendly framework label Nov 11, 2020
@danmoseley danmoseley added the User Story A single user-facing feature. Can be grouped under an epic. label Nov 16, 2020
@marek-safar marek-safar removed the User Story A single user-facing feature. Can be grouped under an epic. label Nov 24, 2020
@marek-safar marek-safar changed the title Blazor sample libraries size reduction tracking Core Managed libraries size-reduction for WebAssembly Nov 27, 2020
@marek-safar marek-safar added size-reduction Issues impacting final app size primary for size sensitive workloads and removed linkable-framework Issues associated with delivering a linker friendly framework labels Dec 9, 2020
@SamMonoRT
Copy link
Member

@jeffhandley @eerhardt @CoffeeFlux - is it possible to group the remaining items by Previews they'll be worked on ?

@SamMonoRT SamMonoRT assigned SamMonoRT and unassigned CoffeeFlux Jun 28, 2021
@eerhardt
Copy link
Member

@SamMonoRT - I believe all 6.0 work in this area is now complete. Should we move this issue to 7.0?

@SamMonoRT
Copy link
Member

Yes, was waiting for the final one from Layomi "JSON serialization source generator Compile-time source generation for System.Text.Json #45448 -- Need @layomia to verify if this is still targetting .NET6 ?"

Else, yes, good to move to 7.0.0

@lewing lewing modified the milestones: 6.0.0, 7.0.0 Jul 31, 2021
@marek-safar marek-safar modified the milestones: 7.0.0, 6.0.0 Sep 2, 2021
@ghost ghost locked as resolved and limited conversation to collaborators Oct 2, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
arch-wasm WebAssembly architecture area-Meta size-reduction Issues impacting final app size primary for size sensitive workloads tracking This issue is tracking the completion of other related issues.
Projects
No open projects
Development

No branches or pull requests

6 participants