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

Optimize .NET Native directives #3561

Closed
natemcmaster opened this issue Oct 26, 2015 · 11 comments
Closed

Optimize .NET Native directives #3561

natemcmaster opened this issue Oct 26, 2015 · 11 comments
Assignees
Labels
closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. type-cleanup
Milestone

Comments

@natemcmaster
Copy link
Contributor

The current runtime directives in our library are not optimized. Runtime-metadata data is included for all EF types, most of which do not need to be reflection enabled. Optimizing the library to include only those types needing metadata will reduce compilation time and resulting .NET Native binary.

@rowanmiller
Copy link
Contributor

@natemcmaster is this critical? It seems like things will become more fragile if we have a list of things we need (that will break all the time). If there is no major downside, then it seems like we should just leave it with everything.

@rowanmiller rowanmiller removed this from the 7.0.0 milestone Dec 11, 2015
@natemcmaster
Copy link
Contributor Author

Not critical. I think we can consider this a pr1 or backlog item. The primary reason for optimizing is to reduce the binary and (potentially) improve compile time.

@rowanmiller
Copy link
Contributor

Closing as this would just makes things more brittle. If we find a good reason to do it in the future then we can reconsider.

@natemcmaster
Copy link
Contributor Author

More info to consider: adding EF.Sqlite RC1 to an empty UWP project increases the appx package (release mode w/ .net native) from 1 MB to about 56 MB, and increases compilation time from about 30 seconds to >5 minutes.

@ErikEJ
Copy link
Contributor

ErikEJ commented Dec 16, 2015

WAT ❓

@natemcmaster
Copy link
Contributor Author

This is due to the excessive metadata included due to ImplyGen.cs. This was necesary to make query work in RC1. Hopefully our new approach for #3801 will fix this.

@divega
Copy link
Contributor

divega commented Dec 16, 2015

Reopening as @natemcmaster needs to do a bit more analysis on how much unnecessary reflection metadata from the EF assemblies is contributing to the size of the binaries and the compilation time.

We should have an automated test suite running on .NET Native to makes sure we are not missing any required reflection metadata.

@divega divega reopened this Dec 16, 2015
@divega divega modified the milestones: 7.0.0-rc2, 7.0.0 Dec 16, 2015
@rowanmiller
Copy link
Contributor

Yep... agreed that is a compelling reason to address this 😄

@natemcmaster
Copy link
Contributor Author

With changes in 9aab799, we've made significant improvement.

Baseline: Blank UWP Project (default template):
Build time: 20.0s
Appx size (x86): 2.42 MB

Baseline + added a reference to EntityFramework.Sqlite:
Build time: 45.9s
Appx size (x86): 10.1 MB

*Build time is the average of 3 build runs on a clean solution, excluding restore and deploy times

@divega
Copy link
Contributor

divega commented Jan 20, 2016

Nice! 🎉

@natemcmaster
Copy link
Contributor Author

Closing now that we have addressed the compiler crashes and excessive metadata inclusion. See #4197. Optimizing further could make EF brittle as it can be hard to keep rdxml in sync with code.

@divega divega added the closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. label May 8, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. type-cleanup
Projects
None yet
Development

No branches or pull requests

4 participants