-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Read PackageDefinitions and PackageDependencies from the cache assets file instead of ResolvePackageDependencies #28263
Conversation
Removing all the conditions that depend on EmitLegacyAssetsFileItems since there is case when this variable is false.
if (messages.Count() == 0) | ||
{ | ||
return string.Empty; | ||
} | ||
|
||
return messages.Max(log => log.Level).ToString(); |
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.
This is double-enumerating messages
. Use a foreach
here to ensure items are only enumerated once.
@ocallesp I started diving into reviewing this, which led me to investigate in more detail how some of this data is used. Based on that I'd like to try changing how we handle this. We are trying to improve the perf of the design-time builds. I believe the design-time build does not depend directly on the The So instead of generating If we do this, @drewnoakes Does this sound like it would work? Is it correct that the project system only depends on the items returned by the |
Also, we'd like to target this feature for |
@dsplaisted that's my understanding, yes. Sounds like a nice optimisation for design-time builds. |
The suggested approach is different from the original one. This pr #28405 implements the new approach. |
Fixes #27738
We want to avoid reading the assets file because it is a large file, which can cause performance degradation in design-time builds for large projects when executing
ResolvePackageDependencies
.To improve this, the assets cache file in
ResolvePackageAssets
will now keep track ofPackageDefinitions
andPackageDependencies
.The change:
Output
PackageDefinitions
andPackageDependencies
items fromResolvePackageAssets
, and modified the targets so thatResolvePackageDependencies
is only called whenEmitLegacyAssetsFileItems
is true.All the code related to
EmitLegacyAssetsFileItems
inResolvePackageDependencies
was removed since there is case for when the value is false.Unit-tests were modified to remove
EmitLegacyAssetsFileItems
in ResolvePackageDependencies.