Commit a677c17
[Xamarin.Android.Build.Tasks] precompile SetVsMonoAndroidRegistryKey (#2130)
In `Xamarin.Android.Sdk.props` we have some inline C# code for a
MSBuild task named `SetVsMonoAndroidRegistryKey`. Which is
understandable, since the code needed is so simple. But thinking
about it, MSBuild has to *compile* this code to run it. Which seems
inherently slower than if we compiled the code during our build.
Currently its entire parent target, `RedirectMonoAndroidSdkPaths`,
takes:
157 ms RedirectMonoAndroidSdkPaths 1 calls
I moved this task inside `Xamarin.Android.Build.Tasks.dll`, and we
appear to get some improvements "for free":
76 ms RedirectMonoAndroidSdkPaths 1 calls
I looked at some past logs, and there are some times where the
`RedirectMonoAndroidSdkPaths` target was taking over 200ms. I
suspect MSBuild might also have some caching functionality for
inlined C# code. There might be a cached assembly somewhere?
Not sure.
What makes this a better fix is that this target runs for all
builds--even builds with no changes.
General changes:
- The `<UsingTask/>` doesn't need a condition, since it will be
lazily evaluated anyways.
- Used string interpolation where it looked nicer.
- Used `LogDebugMessage()` and improved the log message.1 parent 87bb898 commit a677c17
File tree
3 files changed
+27
-12
lines changed- src/Xamarin.Android.Build.Tasks
- MSBuild/Xamarin
- Tasks
3 files changed
+27
-12
lines changedLines changed: 1 addition & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
| 46 | + | |
58 | 47 | | |
59 | 48 | | |
60 | 49 | | |
| |||
Lines changed: 25 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
151 | 151 | | |
152 | 152 | | |
153 | 153 | | |
| 154 | + | |
154 | 155 | | |
155 | 156 | | |
156 | 157 | | |
| |||
0 commit comments