CARVIEW |
Select Language
HTTP/2 200
date: Sun, 27 Jul 2025 11:26:43 GMT
content-type: text/html; charset=utf-8
vary: X-PJAX, X-PJAX-Container, Turbo-Visit, Turbo-Frame, X-Requested-With,Accept-Encoding, Accept, X-Requested-With
x-repository-download: git clone https://github.com/dotnet/android.git
etag: W/"c34dbb39c6f698bee683e93cadea6829"
cache-control: max-age=0, private, must-revalidate
strict-transport-security: max-age=31536000; includeSubdomains; preload
x-frame-options: deny
x-content-type-options: nosniff
x-xss-protection: 0
referrer-policy: no-referrer-when-downgrade
content-security-policy: default-src 'none'; base-uri 'self'; child-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/; connect-src 'self' uploads.github.com www.githubstatus.com collector.github.com raw.githubusercontent.com api.github.com github-cloud.s3.amazonaws.com github-production-repository-file-5c1aeb.s3.amazonaws.com github-production-upload-manifest-file-7fdce7.s3.amazonaws.com github-production-user-asset-6210df.s3.amazonaws.com *.rel.tunnels.api.visualstudio.com wss://*.rel.tunnels.api.visualstudio.com objects-origin.githubusercontent.com copilot-proxy.githubusercontent.com proxy.individual.githubcopilot.com proxy.business.githubcopilot.com proxy.enterprise.githubcopilot.com *.actions.githubusercontent.com wss://*.actions.githubusercontent.com productionresultssa0.blob.core.windows.net/ productionresultssa1.blob.core.windows.net/ productionresultssa2.blob.core.windows.net/ productionresultssa3.blob.core.windows.net/ productionresultssa4.blob.core.windows.net/ productionresultssa5.blob.core.windows.net/ productionresultssa6.blob.core.windows.net/ productionresultssa7.blob.core.windows.net/ productionresultssa8.blob.core.windows.net/ productionresultssa9.blob.core.windows.net/ productionresultssa10.blob.core.windows.net/ productionresultssa11.blob.core.windows.net/ productionresultssa12.blob.core.windows.net/ productionresultssa13.blob.core.windows.net/ productionresultssa14.blob.core.windows.net/ productionresultssa15.blob.core.windows.net/ productionresultssa16.blob.core.windows.net/ productionresultssa17.blob.core.windows.net/ productionresultssa18.blob.core.windows.net/ productionresultssa19.blob.core.windows.net/ github-production-repository-image-32fea6.s3.amazonaws.com github-production-release-asset-2e65be.s3.amazonaws.com insights.github.com wss://alive.github.com api.githubcopilot.com api.individual.githubcopilot.com api.business.githubcopilot.com api.enterprise.githubcopilot.com; font-src github.githubassets.com; form-action 'self' github.com gist.github.com copilot-workspace.githubnext.com objects-origin.githubusercontent.com; frame-ancestors 'none'; frame-src viewscreen.githubusercontent.com notebooks.githubusercontent.com; img-src 'self' data: blob: github.githubassets.com media.githubusercontent.com camo.githubusercontent.com identicons.github.com avatars.githubusercontent.com private-avatars.githubusercontent.com github-cloud.s3.amazonaws.com objects.githubusercontent.com release-assets.githubusercontent.com secured-user-images.githubusercontent.com/ user-images.githubusercontent.com/ private-user-images.githubusercontent.com opengraph.githubassets.com copilotprodattachments.blob.core.windows.net/github-production-copilot-attachments/ github-production-user-asset-6210df.s3.amazonaws.com customer-stories-feed.github.com spotlights-feed.github.com objects-origin.githubusercontent.com *.githubusercontent.com; manifest-src 'self'; media-src github.com user-images.githubusercontent.com/ secured-user-images.githubusercontent.com/ private-user-images.githubusercontent.com github-production-user-asset-6210df.s3.amazonaws.com gist.github.com; script-src github.githubassets.com; style-src 'unsafe-inline' github.githubassets.com; upgrade-insecure-requests; worker-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/
server: github.com
content-encoding: gzip
accept-ranges: bytes
set-cookie: _gh_sess=%2F9WQyKMDjM%2Fp%2FiqFv1RSrzr9%2FemL8TkDNTjn0y3R%2FuEKtcSuUW2KLLMgLsSnHSIP%2BdManATUA6rAg7%2BKaH2CgC9gLGVVPwBFdJf6yCh9HLcoEnF8bP3meCRbzMg65NH35K%2BduIDcH1qiNsZSbyfoyBYalii%2F6InLUBDabpOLIrvVwXGMEjbzjDUSHceioWgFf%2BWuQGw5OMIF2Smp0AG%2BTuwLyyVbV2w8dAtcXgDsLOCUdB1LZBwRa8Nlk5MNaQXwQHus2WESEwOxWbIOOVxhYQ%3D%3D--Ppde6cVqsPcJWtCl--ezhljbu8i6Bae%2FcLgUCWQw%3D%3D; Path=/; HttpOnly; Secure; SameSite=Lax
set-cookie: _octo=GH1.1.640972499.1753615602; Path=/; Domain=github.com; Expires=Mon, 27 Jul 2026 11:26:42 GMT; Secure; SameSite=Lax
set-cookie: logged_in=no; Path=/; Domain=github.com; Expires=Mon, 27 Jul 2026 11:26:42 GMT; HttpOnly; Secure; SameSite=Lax
x-github-request-id: E016:5FFA9:DBC3D4:121A491:68860CF2
[Xamarin.Android.Build.Tasks] <GetImportedLibraries/> perf improvemen… · dotnet/android@3f0152d · GitHub
Copy file name to clipboardExpand all lines: src/Xamarin.Android.Build.Tasks/Tasks/GetImportedLibraries.cs
Copy file name to clipboardExpand all lines: src/Xamarin.Android.Build.Tasks/Xamarin.Android.Common.targets
Skip to content
Navigation Menu
{{ message }}
-
Notifications
You must be signed in to change notification settings - Fork 555
Commit 3f0152d
[Xamarin.Android.Build.Tasks] <GetImportedLibraries/> perf improvements (#2930)
* [Xamarin.Android.Build.Tasks] <GetImportedLibraries/> perf improvements
I noticed a target running on an incremental build with only a XAML
code change:
116 ms _BuildLibraryImportsCache 1 calls
This was using VS 2019 GA, just a blank Xamarin.Forms app.
Reviewing `<GetImportedLibraries/>` it had some general perf
improvements that could be done:
* It called `Directory.EnumerateFiles` three times...
* It used a bunch of LINQ where a `foreach` would do.
Additionally, I saw some improvements I could do at the MSBuild target
level:
<Target Name="_BuildLibraryImportsCache"
Inputs="$(MSBuildProjectFullPath);@(_ReferencePath);@(_ReferenceDependencyPaths);$(_AndroidBuildPropertiesCache);$(_AndroidLibraryProjectImportsCache)"
Outputs="$(_AndroidLibraryImportsCache).stamp">
This target operates on the output of `_ResolveLibraryProjectImports`,
but it was re-running if *any* assembly changed?
I think the `Inputs` and `Outputs` would more appropriately be:
Inputs="$(_AndroidLibraryProjectImportsCache)"
Outputs="$(_AndroidStampDirectory)_BuildLibraryImportsCache.stamp"
This way, if `_ResolveLibraryProjectImports` runs and does work, it
writes to `$(_AndroidLibraryProjectImportsCache)`. We then only need
to run this task when that file changes.
I also updated this target so it follows our new convention for
placing stamp files in `$(_AndroidStampDirectory)`.
~~ Results ~~
An example of an initial build of the Xamarin.Forms project in this
repo:
Before:
299 ms GetImportedLibraries 1 calls
After:
172 ms GetImportedLibraries 1 calls
And then an incremental build, that is a XAML change:
Before:
109 ms _BuildLibraryImportsCache 1 calls
After:
n/a
The task is skipped now:
_BuildLibraryImportsCache:
Skipping target "_BuildLibraryImportsCache" because all output files are up-to-date with respect to the input files.
Overall, I would say there is a ~120ms improvement on initial build.
Incremental builds with XAML changes have a ~100ms improvement.
* Reorder if-else-if for less Path.GetFileName calls1 parent 5ec3e3a commit 3f0152dCopy full SHA for 3f0152d
File tree
Expand file treeCollapse file tree
2 files changed
+31
-25
lines changedFilter options
- src/Xamarin.Android.Build.Tasks
- Tasks
Expand file treeCollapse file tree
2 files changed
+31
-25
lines changedsrc/Xamarin.Android.Build.Tasks/Tasks/GetImportedLibraries.cs
Copy file name to clipboardExpand all lines: src/Xamarin.Android.Build.Tasks/Tasks/GetImportedLibraries.cs+25-19Lines changed: 25 additions & 19 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1 | 1 |
| |
2 | 2 |
| |
3 |
| - | |
4 | 3 |
| |
5 | 4 |
| |
6 |
| - | |
7 | 5 |
| |
8 |
| - | |
9 | 6 |
| |
10 | 7 |
| |
11 |
| - | |
12 | 8 |
| |
13 | 9 |
| |
14 | 10 |
| |
| |||
36 | 32 |
| |
37 | 33 |
| |
38 | 34 |
| |
39 |
| - | |
40 |
| - | |
41 | 35 |
| |
42 | 36 |
| |
43 | 37 |
| |
44 | 38 |
| |
45 |
| - | |
| 39 | + | |
46 | 40 |
| |
47 |
| - | |
48 |
| - | |
49 |
| - | |
50 |
| - | |
51 |
| - | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
52 | 58 |
| |
| 59 | + | |
53 | 60 |
| |
54 |
| - | |
55 |
| - | |
56 |
| - | |
57 |
| - | |
58 |
| - | |
59 |
| - | |
60 |
| - | |
| 61 | + | |
| 62 | + | |
61 | 63 |
| |
62 | 64 |
| |
63 | 65 |
| |
| |||
70 | 72 |
| |
71 | 73 |
| |
72 | 74 |
| |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
73 | 79 |
| |
74 | 80 |
| |
75 | 81 |
| |
|
src/Xamarin.Android.Build.Tasks/Xamarin.Android.Common.targets
Copy file name to clipboardExpand all lines: src/Xamarin.Android.Build.Tasks/Xamarin.Android.Common.targets+6-6Lines changed: 6 additions & 6 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1469 | 1469 |
| |
1470 | 1470 |
| |
1471 | 1471 |
| |
1472 |
| - | |
1473 |
| - | |
1474 |
| - | |
| 1472 | + | |
| 1473 | + | |
| 1474 | + | |
| 1475 | + | |
1475 | 1476 |
| |
1476 | 1477 |
| |
1477 |
| - | |
| 1478 | + | |
1478 | 1479 |
| |
1479 |
| - | |
| 1480 | + | |
1480 | 1481 |
| |
1481 | 1482 |
| |
1482 | 1483 |
| |
| |||
3227 | 3228 |
| |
3228 | 3229 |
| |
3229 | 3230 |
| |
3230 |
| - | |
3231 | 3231 |
| |
3232 | 3232 |
| |
3233 | 3233 |
| |
|
You can’t perform that action at this time.
0 commit comments