Aspnetcore: Optimize the BCL

Created on 7 Feb 2018  路  3Comments  路  Source: dotnet/aspnetcore

The work here is to:

  • [x] Setup illink on the project.
  • [x] Run the linker through the app.
  • [ ] Determine what references are left behind on the app and what of those things are potential candidates to strip.
area-blazor

Most helpful comment

So far I've been able to run this on StandaloneApp and I've been able to trim the BCL to
image

The command that i've used is

illink.exe -a .\Microsoft.AspNetCore.Blazor.Browser.dll \
 -a .\Microsoft.AspNetCore.Blazor.dll -a .\StandaloneApp.dll \
-d .\dist\_framework\_bin\ -c link -out .\optimized --skip-unresolved true

mscorlib is by a large margin the biggest assembly here. Zipping the remaining files leaves them at around 590K

image

image

Above is the remaining namespaces left on the assembly.

The next step is to determine what of those things can go away and see how much we save.

All 3 comments

So far I've been able to run this on StandaloneApp and I've been able to trim the BCL to
image

The command that i've used is

illink.exe -a .\Microsoft.AspNetCore.Blazor.Browser.dll \
 -a .\Microsoft.AspNetCore.Blazor.dll -a .\StandaloneApp.dll \
-d .\dist\_framework\_bin\ -c link -out .\optimized --skip-unresolved true

mscorlib is by a large margin the biggest assembly here. Zipping the remaining files leaves them at around 590K

image

image

Above is the remaining namespaces left on the assembly.

The next step is to determine what of those things can go away and see how much we save.

@javiercn IMHO anything that would in essence be anything that would break outside the browser sandbox? things like Win32, file IO etc. these could be placed with interop with browser APIs which could save quite a bit of space ;)

loving the work on this now it's an official project of research; can't wait to see what the teams direction is on the feature roadmap @SteveSandersonMS +1

Done 59635331601dc8496c7cd5958552dec24d1b0ffd.
https://github.com/aspnet/Blazor/issues/245 Tracks further improvements

Was this page helpful?
0 / 5 - 0 ratings

Related issues

BrennanConroy picture BrennanConroy  路  3Comments

Kevenvz picture Kevenvz  路  3Comments

TanvirArjel picture TanvirArjel  路  3Comments

aurokk picture aurokk  路  3Comments

guardrex picture guardrex  路  3Comments