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

Allow stripping away all model building code to reduce application size #29755

Closed
Tracked by #21894
roji opened this issue Dec 4, 2022 · 3 comments
Closed
Tracked by #21894

Allow stripping away all model building code to reduce application size #29755

roji opened this issue Dec 4, 2022 · 3 comments
Labels
area-aot area-model-building closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. customer-reported type-enhancement
Milestone

Comments

@roji
Copy link
Member

roji commented Dec 4, 2022

Since users can support precompiled models, model building code shouldn't be needed in runtime, and we can get rid of it to reduce application size. This is especially important for AOT, but isn't necessarily coupled to it.

EF invokes model building implicitly, i.e. there's no explicit gesture for building a model. This unfortunately means that normal trimming cannot detect that model building isn't being used in the application - unless we change EF's API and introduce a breaking change around this (e.g. a new API to trigger model building, without which implicit model building doesn't occur).

We can instead use a feature switch to allow users to opt into stripping the model building code. This feature switch could be activated automatically when publishing to AOT.

@AndriySvyryd
Copy link
Member

Fixed for AOT in d6fdc4d
Feature switches for trimming are tracked by #24901

@AndriySvyryd AndriySvyryd added closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. and removed consider-for-current-release labels Jul 22, 2023
@AndriySvyryd AndriySvyryd modified the milestones: Backlog, 8.0.0 Jul 22, 2023
@AndriySvyryd AndriySvyryd removed their assignment Jul 22, 2023
@roji
Copy link
Member Author

roji commented Jul 22, 2023

@AndriySvyryd d6fdc4d seems to be about SQLite, is it related to stripping away model building code?

@AndriySvyryd
Copy link
Member

@ajcvickers ajcvickers modified the milestones: 8.0.0, 8.0.0-rc1 Aug 19, 2023
@ajcvickers ajcvickers modified the milestones: 8.0.0-rc1, 8.0.0 Nov 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-aot area-model-building closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. customer-reported type-enhancement
Projects
None yet
Development

No branches or pull requests

3 participants