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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve trimming support for EF Core apps to reduce application size #21894

Open
1 of 7 tasks
Tracked by #19588 ...
roji opened this issue Aug 1, 2020 · 5 comments
Open
1 of 7 tasks
Tracked by #19588 ...

Improve trimming support for EF Core apps to reduce application size #21894

roji opened this issue Aug 1, 2020 · 5 comments
Assignees
Labels
area-aot area-global composite-issue A grouping of multiple related issues into one issue needs-design punted-for-6.0 type-enhancement User Story A single user-facing feature. Can be grouped under an epic.
Projects
Milestone

Comments

@roji
Copy link
Member

roji commented Aug 1, 2020

This is a grouping of related issues. Feel free to vote (馃憤) for this issue to indicate that this is an area that you think we should spend time on, but consider also voting for individual issues for things you consider especially important.


ILLinker allows making application size smaller by trimming code that isn't actually used. This is problematic in various dynamic/reflection scenarios, where the linker is unable to know that a method is actually needed.

Done in 8.0

Backlog

Resources:

FYI the regression testing strategy for this isn't trivial
Relevant blog post: https://devblogs.microsoft.com/dotnet/app-trimming-in-net-5/

@ajcvickers ajcvickers added this to the Backlog milestone Aug 3, 2020
@ajcvickers ajcvickers modified the milestones: Backlog, 6.0.0 Nov 4, 2020
@roji roji changed the title Use dynamic access annotations for better linker trimming Developers can safely trim EF Core apps to reduce application size Feb 4, 2021
@roji roji added the User Story A single user-facing feature. Can be grouped under an epic. label Feb 4, 2021
@roji roji added this to Committed in .NET 6.0 Feb 4, 2021
@roji roji changed the title Developers can safely trim EF Core apps to reduce application size Improve trimming support for EF Core apps to reduce application size Feb 4, 2021
@ajcvickers ajcvickers modified the milestones: 6.0.0, Backlog May 5, 2021
@roji roji moved this from Committed to Cut in .NET 6.0 Aug 2, 2021
@hez2010
Copy link
Contributor

hez2010 commented Aug 14, 2021

I think the implementation of this method need to be revisited:

assembly = Assembly.Load(new AssemblyName("SQLitePCLRaw.batteries_v2"));

Why not call SQLitePCL.Batteries_V2.Init() directly?

@ajcvickers ajcvickers added this to the 7.0.0 milestone Oct 25, 2021
@21r8390

This comment has been minimized.

@roji

This comment has been minimized.

@AndriySvyryd
Copy link
Member

For .NET 6: https://docs.microsoft.com/en-us/dotnet/core/deploying/trimming/prepare-libraries-for-trimming

@AndriySvyryd
Copy link
Member

Also take dotnet/runtime#61231 into account.
https://github.com/hez2010/EFCore.NativeAOT is a sample app that shows the common things that need to be configured.
c651888 contains our initial stab at this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-aot area-global composite-issue A grouping of multiple related issues into one issue needs-design punted-for-6.0 type-enhancement User Story A single user-facing feature. Can be grouped under an epic.
Projects
.NET 6.0
  
Cut
Development

No branches or pull requests

5 participants