CARVIEW |
Select Language
HTTP/2 200
date: Sun, 27 Jul 2025 05:44:11 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/"c4cb5fce7d6b4ce48a05a525990daf8a"
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=5dDXV9qWeotj%2FDqRMeBYLKHyk2CaVJTwi4pZ%2FwzHmltyy%2FBX%2FXaUo1S%2B1Pe23X%2FVhH8I2TnAeL9lwWyNealUqVgVKd4oZWCuluZamYrnmHviPN3PT5Bb65hKHea3rjuD%2BaEfGs8IA9eKOC1jm8D%2Fp2aM%2BdHoU1lxAw0FXQSeC%2BLrHG2T3NQKpr1rPXFdTLcm%2FIjcAEo%2BDm1qBzov9%2FvboIvTD4t80h%2BdCE87qQ%2FvVX10lUAAudAcrciu%2FT%2F6AttdL4WWZNCEFUX0tsB7rjt6NQ%3D%3D--pCPT5JwTLTWbPaBs--iqTOX%2BpRajSD6sT0onRx7Q%3D%3D; Path=/; HttpOnly; Secure; SameSite=Lax
set-cookie: _octo=GH1.1.721879747.1753595050; Path=/; Domain=github.com; Expires=Mon, 27 Jul 2026 05:44:10 GMT; Secure; SameSite=Lax
set-cookie: logged_in=no; Path=/; Domain=github.com; Expires=Mon, 27 Jul 2026 05:44:10 GMT; HttpOnly; Secure; SameSite=Lax
x-github-request-id: 87A8:0A67:58209:747D6:6885BCAA
[Xamarin.Android.Build.Tasks] Profiled AOT can Full AOT the main asse… · dotnet/android@8ac4425 · GitHub
Copy file name to clipboardExpand all lines: src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.Aot.targets
Copy file name to clipboardExpand all lines: src/Xamarin.Android.Build.Tasks/Tasks/Aot.cs
Copy file name to clipboardExpand all lines: src/Xamarin.Android.Build.Tasks/Tasks/GetAotArguments.cs
Copy file name to clipboard
Copy file name to clipboardExpand all lines: src/Xamarin.Android.Build.Tasks/Xamarin.Android.Legacy.targets
Copy file name to clipboardExpand all lines: tests/apk-sizes-reference/Xamarin.Forms_Performance_Integration-Signed-Release-Profiled-Aot.apkdesc
Skip to content
Navigation Menu
{{ message }}
-
Notifications
You must be signed in to change notification settings - Fork 555
Commit 8ac4425
authored
[Xamarin.Android.Build.Tasks] Profiled AOT can Full AOT the main assembly (#6482)
When using the built-in profiles for Profiled AOT, one drawback is
the user's code isn't AOT'd. We only AOT types that are called in
the BCL, `Java.Interop.dll`, `Mono.Android.dll`, etc.
To make this better, we can AOT the "main" assembly. Most code in
the users' main assembly would likely get called on startup. This
should have a minor impact to `.apk` size, but gain us a better
startup boost by default.
When testing, I can see more methods AOT'd:
11-11 09:01:01.441 16386 16386 D Mono : AOT: FOUND method foo.MainActivity:OnCreate (Android.OS.Bundle) [0x7c050e8e20f0 - 0x7c050e8e213b 0x7c050e8e2673]
~~ Results ~~
| Test | File Size (Δ) | Activity Displayed (Δ) |
| ------------------------------------- | ----------------: | ------------------------: |
| `dotnet new android` w/o AOT app | -baseline- | 193ms |
| `dotnet new android` *with* AOT app | (0%) | 192ms (99%) |
| `dotnet new maui` w/o AOT app | -baseline- | 641ms |
| `dotnet new maui` *with* AOT app | +20,480 (0.14%) | 627ms (98%) |
The `dotnet new android` app is built with:
> dotnet build -c Release -p:AndroidEnableProfiledAot=true -p:RunAOTCompilation=true -r android-arm64 -p:AndroidPackageFormat=apk
File size differences:
> apkdiff -f before.apk after.apk
Size difference in bytes ([*1] apk1 only, [*2] apk2 only):
+ 5,632 lib/arm64-v8a/libaot-foo.dll.so
+ 5 assemblies/assemblies.blob
Summary:
+ 5 Other entries 0.00% (of 787,048)
+ 0 Dalvik executables 0.00% (of 345,340)
+ 5,632 Shared libraries 0.09% (of 6,008,168)
+ 0 Package size difference 0.00% (of 3,169,571)
10 runs on a Pixel 5 was an average of 193ms before, and 192ms after
(the `Activity Displayed` time). There may not, in fact, be a
difference for `dotnet new android`.
Next I installed .NET MAUI 6.0.101-preview.11.2149, and tried a
`dotnet new maui` app:
File size:
> apkdiff -f before.apk after.apk
Size difference in bytes ([*1] apk1 only, [*2] apk2 only):
+ 67,144 lib/arm64-v8a/libaot-foo.dll.so
Summary:
+ 0 Other entries 0.00% (of 7,765,174)
+ 0 Dalvik executables 0.00% (of 6,443,152)
+ 67,144 Shared libraries 0.50% (of 13,388,688)
+ 20,480 Package size difference 0.14% (of 14,272,332)
Total file size difference:
--14,251,852
++14,272,332
The average over 10 runs on a Pixel 5, before applying this change,
is ~641ms. After applying this change, it's ~627ms.
I think this might help startup by ~14ms in a `dotnet new maui` app.
It would likely improve more depending on the app.1 parent f3de57d commit 8ac4425Copy full SHA for 8ac4425
File tree
Expand file treeCollapse file tree
6 files changed
+108
-76
lines changedFilter options
- src/Xamarin.Android.Build.Tasks
- Microsoft.Android.Sdk/targets
- Tasks
- tests/apk-sizes-reference
Expand file treeCollapse file tree
6 files changed
+108
-76
lines changedsrc/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.Aot.targets
Copy file name to clipboardExpand all lines: src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.Aot.targets+12-17Lines changed: 12 additions & 17 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
30 | 30 |
| |
31 | 31 |
| |
32 | 32 |
| |
33 |
| - | |
| 33 | + | |
34 | 34 |
| |
35 | 35 |
| |
36 | 36 |
| |
| |||
43 | 43 |
| |
44 | 44 |
| |
45 | 45 |
| |
46 |
| - | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
47 | 50 |
| |
48 | 51 |
| |
49 | 52 |
| |
50 | 53 |
| |
51 | 54 |
| |
52 | 55 |
| |
53 | 56 |
| |
| 57 | + | |
| 58 | + | |
54 | 59 |
| |
55 | 60 |
| |
56 | 61 |
| |
57 | 62 |
| |
58 |
| - | |
59 |
| - | |
60 |
| - | |
61 |
| - | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
62 | 66 |
| |
63 | 67 |
| |
64 | 68 |
| |
65 | 69 |
| |
66 |
| - | |
67 |
| - | |
68 |
| - | |
69 |
| - | |
70 |
| - | |
71 |
| - | |
72 |
| - | |
73 |
| - | |
74 |
| - | |
| 70 | + | |
75 | 71 |
| |
76 |
| - | |
| 72 | + | |
77 | 73 |
| |
78 |
| - | |
79 | 74 |
| |
80 | 75 |
| |
81 | 76 |
| |
|
src/Xamarin.Android.Build.Tasks/Tasks/Aot.cs
Copy file name to clipboardExpand all lines: src/Xamarin.Android.Build.Tasks/Tasks/Aot.cs+11-3Lines changed: 11 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
32 | 32 |
| |
33 | 33 |
| |
34 | 34 |
| |
35 |
| - | |
36 |
| - | |
37 |
| - | |
38 | 35 |
| |
39 | 36 |
| |
40 | 37 |
| |
| |||
145 | 142 |
| |
146 | 143 |
| |
147 | 144 |
| |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
148 | 156 |
| |
149 | 157 |
| |
150 | 158 |
| |
|
src/Xamarin.Android.Build.Tasks/Tasks/GetAotArguments.cs
Copy file name to clipboardExpand all lines: src/Xamarin.Android.Build.Tasks/Tasks/GetAotArguments.cs+7-53Lines changed: 7 additions & 53 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2 | 2 |
| |
3 | 3 |
| |
4 | 4 |
| |
5 |
| - | |
6 | 5 |
| |
7 | 6 |
| |
8 | 7 |
| |
| |||
12 | 11 |
| |
13 | 12 |
| |
14 | 13 |
| |
15 |
| - | |
| 14 | + | |
16 | 15 |
| |
17 |
| - | |
| 16 | + | |
18 | 17 |
| |
19 |
| - | |
20 |
| - | |
21 | 18 |
| |
22 | 19 |
| |
23 | 20 |
| |
| |||
30 | 27 |
| |
31 | 28 |
| |
32 | 29 |
| |
| 30 | + | |
| 31 | + | |
| 32 | + | |
33 | 33 |
| |
34 | 34 |
| |
35 | 35 |
| |
| |||
54 | 54 |
| |
55 | 55 |
| |
56 | 56 |
| |
57 |
| - | |
58 |
| - | |
59 |
| - | |
60 |
| - | |
61 |
| - | |
| 57 | + | |
| 58 | + | |
62 | 59 |
| |
63 | 60 |
| |
64 | 61 |
| |
| |||
110 | 107 |
| |
111 | 108 |
| |
112 | 109 |
| |
113 |
| - | |
114 |
| - | |
115 |
| - | |
116 |
| - | |
117 |
| - | |
118 |
| - | |
119 |
| - | |
120 |
| - | |
121 |
| - | |
122 |
| - | |
123 |
| - | |
124 |
| - | |
125 |
| - | |
126 |
| - | |
127 |
| - | |
128 |
| - | |
129 |
| - | |
130 |
| - | |
131 |
| - | |
132 |
| - | |
133 |
| - | |
134 |
| - | |
135 |
| - | |
136 |
| - | |
137 |
| - | |
138 |
| - | |
139 |
| - | |
140 |
| - | |
141 |
| - | |
142 |
| - | |
143 |
| - | |
144 |
| - | |
145 |
| - | |
146 |
| - | |
147 |
| - | |
148 |
| - | |
149 | 110 |
| |
150 | 111 |
| |
151 | 112 |
| |
| |||
252 | 213 |
| |
253 | 214 |
| |
254 | 215 |
| |
255 |
| - | |
256 |
| - | |
257 |
| - | |
258 |
| - | |
259 |
| - | |
260 |
| - | |
261 |
| - | |
262 | 216 |
| |
263 | 217 |
| |
264 | 218 |
| |
|
src/Xamarin.Android.Build.Tasks/Tasks/GetAotAssemblies.cs
Copy file name to clipboard+74Lines changed: 74 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 | + |
src/Xamarin.Android.Build.Tasks/Xamarin.Android.Legacy.targets
Copy file name to clipboardExpand all lines: src/Xamarin.Android.Build.Tasks/Xamarin.Android.Legacy.targets+1Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
700 | 700 |
| |
701 | 701 |
| |
702 | 702 |
| |
| 703 | + | |
703 | 704 |
| |
704 | 705 |
| |
705 | 706 |
| |
|
tests/apk-sizes-reference/Xamarin.Forms_Performance_Integration-Signed-Release-Profiled-Aot.apkdesc
Copy file name to clipboardExpand all lines: tests/apk-sizes-reference/Xamarin.Forms_Performance_Integration-Signed-Release-Profiled-Aot.apkdesc+3-3Lines changed: 3 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
245 | 245 |
| |
246 | 246 |
| |
247 | 247 |
| |
248 |
| - | |
| 248 | + | |
249 | 249 |
| |
250 | 250 |
| |
251 | 251 |
| |
| |||
389 | 389 |
| |
390 | 390 |
| |
391 | 391 |
| |
392 |
| - | |
| 392 | + | |
393 | 393 |
| |
394 | 394 |
| |
395 | 395 |
| |
| |||
2243 | 2243 |
| |
2244 | 2244 |
| |
2245 | 2245 |
| |
2246 |
| - | |
| 2246 | + | |
2247 | 2247 |
|
You can’t perform that action at this time.
0 commit comments