-
Notifications
You must be signed in to change notification settings - Fork 127
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
Add design for lazy loading #1626
Conversation
docs/design/assembly-loading.md
Outdated
|
||
### Exceptions to lazy loading | ||
|
||
When the linker default action is `copy`, we will preserve the .NET5 behavior that keeps all statically referenced assemblies (that don't override the default action). For consistency with this behavior, static references of dynamically loaded assemblies will be kept as well. This will be done by pre-loading the reference closure of assemblies if the linker's default action is `copy`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When the linker default action is
copy
What does it mean? linker rarely runs in a single action mode
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I meant -c
/-u
. I'm struggling a bit with how this should work. Maybe it would be ok to remove support for -c copy
/-u copy
instead, though we probably need to figure out #1269 before making that decision (there was a suggestion to use copy
as the default action).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we will always need to load all referenced assemblies, to support opting in to trimming via attributes. Even if we don't do it by passing -c copy -u copy
, we want everything without an attribute to be kept - so we need to look at references. Maybe we can do it without reading the entire assembly, so that we still get some perf savings from lazy loading.
This is a proposal for lazy loading to solve #1164 and related issues. This replaces the plan outlined in #1164 (comment), but there is some overlap because we still need to process references up-front for the
copy
action, if we want to preserve the current behavior.I created a new branch for the feature that we can use to avoid breaking the constant propagation behavior in master.