Commit b0efc6a
[performance] initial MSBuild project timing (#1569)
"Performance", in various guises, is an ongoing focus. For example,
we track [application startup times][time-plots].
[time-plots]: https://jenkins.mono-project.com/view/Xamarin.Android/job/xamarin-android/plot/Tests%20times/
The next area we want to concentrate on is build and deployment time,
and to do so we need to start collecting information so we know how
we're doing, and whether anything is getting worse.
The first step in tracking our build times is to track the build
times for some of our existing unit tests projects, and plot those
on Jenkins. This is done by using a custom MSBuild logger
`Xamarin.Android.Tools.BootstrapTasks.TimingLogger` which records
detailed timing information into an XML file:
<builds>
<build
start-ticks="636607852701529939"
start-threadid="1"
id="HelloWorld-FreshBuild"
commit="8dcd59e"
description="A fresh build after a clean checkout for HelloWorld"
end-ticks="636607852899547509"
end-threadid="1"
elapsed="00:00:19.8017570"
succeeded="True">
<toolsets>
<toolset version="15.0" path="C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin" />
</toolsets>
<files>
<file id="1" path="C:\Users\jopepper\Desktop\Git\xamarin-android\samples\HelloWorld\HelloWorld.csproj" />
</files>
<project
start-ticks="636607852707145402"
start-threadid="6"
file-id="1"
end-ticks="636607852899326841"
end-threadid="6"
elapsed="00:00:19.2181439"
succeeded="True">
<target
start-ticks="636607852707365985"
start-threadid="6"
name="RedirectMonoAndroidSdkPaths"
file-id="2"
end-ticks="636607852708932958"
end-threadid="6"
elapsed="00:00:00.1566973"
succeeded="True">
<task
start-ticks="636607852708755105"
start-threadid="6"
name="SetVsMonoAndroidRegistryKey"
file-id="2"
end-ticks="636607852708895478"
end-threadid="6"
elapsed="00:00:00.0140373"
succeeded="True"
/>
</target>
</project>
</build>
</builds>
These timing XML files from multiple builds are aggregated by the new
`<ProcessMSBuildTiming/>` task, which generates a CSV file containing
the `//*/@elapsed` attribute values for us by the
[Jenkins Plots plugin][jenkins-plots].
[jenkins-plots]: https://wiki.jenkins.io/display/JENKINS/Plot+Plugin
The following projects have their build times collected:
- `samples/HelloWorld`
- `tests/Xamarin.Forms-Performance-Integration`
Across four types of builds:
- Fresh build (simulated fresh checkout)
- Second build (no changes)
- Touch C# file, build again
- Touch Android resource XML file, build again
We are timing the `SignAndroidPackage` and `Install` targets for each
of these build types.
Results are aggregated into `TestResult-MSBuild-times.csv` for
processing on Jenkins. After this gets merged into master, there will
be some configuration needed to setup the new plot.
Example results, in the aggregated CSV file:
| HelloWorld-FreshBuild-Debug | HelloWorld-FreshInstall-Debug | XF-FreshBuild-Debug | XF-FreshInstall-Debug |
| ---: | ---: | ---: | ---: |
| 00:00:16.3538291 | 00:00:04.7940071 | 00:00:27.5263076 | 00:00:22.6720137 |
Also included in the table, will be the `TouchCSharp` and
`TouchAndroidResource` builds for both of the `HelloWorld` and `XF`
projects for both `SignAndroidPackage` and `Install` targets.
Other changes:
- I let Visual Studio 2017 re-sort/fixup `Xamarin.Android.sln`
- Split up `timing.csproj` into `timing.targets` and `timing.projitems`
- Updated `Makefile` to include a `run-performance-tests` target.
`TimingLogger` is courtesy of @grendello.1 parent 5e0a39c commit b0efc6a
File tree
9 files changed
+658
-18
lines changed- build-tools
- Xamarin.Android.Tools.BootstrapTasks
- Xamarin.Android.Tools.BootstrapTasks
- scripts
- timing
9 files changed
+658
-18
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
197 | 197 | | |
198 | 198 | | |
199 | 199 | | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
200 | 203 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | 1 | | |
3 | | - | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
71 | 72 | | |
72 | 73 | | |
73 | 74 | | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
74 | 79 | | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
75 | 84 | | |
76 | 85 | | |
77 | 86 | | |
| |||
181 | 190 | | |
182 | 191 | | |
183 | 192 | | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
184 | 200 | | |
185 | 201 | | |
186 | | - | |
187 | 202 | | |
| 203 | + | |
188 | 204 | | |
189 | 205 | | |
190 | 206 | | |
| |||
208 | 224 | | |
209 | 225 | | |
210 | 226 | | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
211 | 231 | | |
212 | 232 | | |
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| 50 | + | |
50 | 51 | | |
51 | 52 | | |
| 53 | + | |
52 | 54 | | |
53 | 55 | | |
54 | 56 | | |
| |||
Lines changed: 81 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 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
0 commit comments