From b073be3e136f8411fe42af4ac01f89ea8c48c9af Mon Sep 17 00:00:00 2001 From: Jonathan Peppers Date: Tue, 16 Oct 2018 16:27:13 -0500 Subject: [PATCH] [Xamarin.Android.Build.Tasks] remove unused Inputs/Outputs While reviewing our MSBuild targets, I noticed three targets that declared `Inputs` and `Outputs`, but did not actually update any files: - `_CollectConfigFiles` - `_CollectMdbFiles` - `_CollectPdbFiles` This means that MSBuild was unnecessarily looking at files to see if they exist, and might be comparing timestamps as well. The targets would also _always_ run, so it doesn't matter to have `Inputs` and `Outputs` in these targets at all! I basically removed these `Inputs` and `Outputs`, and saw a performance gain with just doing that. I also saw performance gains to targets that depend on these three targets. Since `Inputs` and `Outputs` timing is internal to MSBuild, I am not sure where the actual time is being tallied here. Before: 1 ms _CopyConfigFiles 1 calls 3 ms _CopyMdbFiles 2 calls 3 ms _CollectMdbFiles 1 calls 4 ms _CopyPdbFiles 1 calls 5 ms _CollectPdbFiles 1 calls 5 ms _CollectConfigFiles 1 calls 20 ms _ConvertPdbFiles 1 calls A total of ~46ms After: 0 ms _ConvertPdbFiles 1 calls 0 ms _CopyPdbFiles 1 calls 1 ms _CollectMdbFiles 1 calls 1 ms _CopyMdbFiles 2 calls 1 ms _CopyConfigFiles 1 calls 2 ms _CollectConfigFiles 1 calls 5 ms _CollectPdbFiles 1 calls A total of ~10ms An overall improvement of ~36ms. This was the `samples/HelloWorld` project in this repo, a build with no changes. I suspect the improvement would be even better for larger projects. --- .../Xamarin.Android.Common.targets | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Common.targets b/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Common.targets index 468ec4f83e7..05112ab458d 100755 --- a/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Common.targets +++ b/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Common.targets @@ -1989,9 +1989,7 @@ because xbuild doesn't support framework reference assemblies. - + @@ -2009,8 +2007,6 @@ because xbuild doesn't support framework reference assemblies. - +