[Xamarin.Android.Build.Tasks] perf improvements for <ResolveAssemblies/> #4236
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When building the SmartHotel360 app, I found that
<ResolveAssemblies/>
was loading the NuGetProjectAssetFile
/LockFile
even though it was not used by the task at all. Putting aStopwatch
around the code, I also found it to be somewhat expensive.I reworked the code to use a
Lazy<T>
for accessing theLockFile
.This way it is not actually loaded until it is needed.
I also found several
LogDebugMessage
calls that seemed to be toomuch... The
<ResolveAssemblies/>
was emitting hundreds of lines oflogging in the SmartHotel360 app.
I removed two messages such as:
The
[Input]
and[Output]
values for the task and the remaining logmessage should be sufficient for understanding what we need from
customer logs:
The results for a build with no changes with the SmartHotel360 app:
This saves ~82ms, and since this task runs on every
Build
andInstall
, it could save ~164ms from the dev-loop.