CARVIEW |
Select Language
HTTP/2 200
date: Sun, 27 Jul 2025 10:09:42 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/"e35b12fe383073ee1a279fff7ba6e728"
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=rRLCvE3Zx47y37SHdKV6RTZZJKjCKUZCZnx2D3yR3ZBP%2B7ENQAIKKqUF2YHnhjg%2F%2F4kSf7zSAJlLOf2iycx2lj7%2FIK3RSgnbVmKars0huTRQFFluSETPX7GUcl2U%2FxDm6Tp8%2BrRvauZxigKdsFWwXiOycQwq0oNAR40T3yx51%2FgYyPA%2FBDIfdbjdVszm1a0N1ojXXAz6Q8g%2F5y95QQf2lIYauLr%2FD267Khi01wKmtmi88T0RLcvDtWFXAc198i2WO%2BV7dxZ810xgC4WJO67eWg%3D%3D--4rpEL%2BylVwMT%2Bty%2F--TT4MDNuG1LCEz2b21ynqrQ%3D%3D; Path=/; HttpOnly; Secure; SameSite=Lax
set-cookie: _octo=GH1.1.1078174191.1753610982; Path=/; Domain=github.com; Expires=Mon, 27 Jul 2026 10:09:42 GMT; Secure; SameSite=Lax
set-cookie: logged_in=no; Path=/; Domain=github.com; Expires=Mon, 27 Jul 2026 10:09:42 GMT; HttpOnly; Secure; SameSite=Lax
x-github-request-id: A62A:1A1F38:D28EB0:116010E:6885FAE5
[monodroid] Pre-allocate buffers for embedded assembly names (#6188) · dotnet/android@69289d7 · GitHub
Copy file name to clipboardExpand all lines: src/Xamarin.Android.Build.Tasks/Tasks/GeneratePackageManagerJava.cs
Copy file name to clipboardExpand all lines: src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/Utilities/EnvironmentHelper.cs
Copy file name to clipboardExpand all lines: src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Resources/Base/BuildReleaseArm64XFormsDotNet.apkdesc
Skip to content
Navigation Menu
{{ message }}
-
Notifications
You must be signed in to change notification settings - Fork 555
Commit 69289d7
authored
[monodroid] Pre-allocate buffers for embedded assembly names (#6188)
When Embedded Assemblies are used (`$(EmbedAssembliesIntoApk)`=True),
assembly names are detected during `.apk` content traversal,
duplicated, and stored into `bundled_assemblies` and
`MonoBundledAssembly::name`.
Reduce memory allocations by updating `libxamarin-app.so` to contain
a `bundled_assembly_names` array, a'la:
struct XamarinAndroidBundledAssembly {
int32_t apk_fd;
uint32_t data_offset;
uint32_t data_size;
uint8_t *data;
uint32_t name_length;
char *name;
};
constexpr size_t AssemblyNameWidth;
static char assembly_name_1 [AssemblyNameWidth];
static char assembly_name_2 [AssemblyNameWidth];
// …
extern "C" XamarinAndroidBundledAssembly bundled_assemblies[] = {
{
.apk_fd = -1,
.data_offset = 0,
.data_size = 0,
.name_length = 0,
.name = assembly_name_1,
},
{
.apk_fd = -1,
.data_offset = 0,
.data_size = 0,
.name_length = 0,
.name = assembly_name_2,
},
// …
}
The `bundled_assemblies` array *doesn't* contain the assembly names
detected during packaging time. Rather, it contains *buffers*, each
large enough to hold any assembly name.
This removes the need to allocate additional memory for assembly
names during process startup. (We'll still need to allocate memory
for other entries within the `.apk`, such as `.pdb` files.)
Additionally, a provision is made for adding more assemblies than
those counted and placed in the .`apk` during the build. This may
come handy when Xamarin.Android supports split applications (with
components placed in different `.apk` files), and also as a simple
fail-safe feature should the build miscalculate something.
Debug information for assemblies is no longer registered when reading
the APK, but rather whenever an assembly load is requested by Mono.
Neither the assemblies nor their debug information are mmapped when
reading the APK anymore. This is done lazily when assembly load is
requested by Mono. Mapping of files after the startup phase is
protected with a POSIX semaphore.
Additionally, a handful of simple optimizations are implemented:
* We no longer query the device's memory page size whenever we
`mmap()` a file; the value is instead queried and cached in the
`Util` constructor.
* The current AppDomain is no longer queried when getting a Mono
object's type under .NET 6
* Many log statements are no longer run by default during startup.
These changes reduce startup time for a simple plain
Xamarin.Android application (one control in a layout) by around 4ms
measured for `Displayed` time, and by around 2ms when measured for
native runtime startup.
For the `Hello Maui` sample from the `maui-samples` repository, the
startup time is reduced by ~200ms measured for `Displayed` time (from
~1.6s to ~1.4s), with the same speed up for the native runtime as in
the plain Xamarin.Android test above.
Performance was measured on a Pixel 3XL phone running Android 12 beta.
*Note*: the `Displayed` measurements were found to be **very** unstable
during testing on Android 12, with variance between runs reaching 600ms
sometimes.1 parent ff0d05f commit 69289d7Copy full SHA for 69289d7
File tree
Expand file treeCollapse file tree
18 files changed
+1411
-1045
lines changedFilter options
- src
- Xamarin.Android.Build.Tasks
- Tasks
- Tests
- Xamarin.Android.Build.Tests/Utilities
- Xamarin.ProjectTools/Resources/Base
- Utilities
- monodroid/jni
Expand file treeCollapse file tree
18 files changed
+1411
-1045
lines changedsrc/Xamarin.Android.Build.Tasks/Tasks/GeneratePackageManagerJava.cs
Copy file name to clipboardExpand all lines: src/Xamarin.Android.Build.Tasks/Tasks/GeneratePackageManagerJava.cs+29Lines changed: 29 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
269 | 269 |
| |
270 | 270 |
| |
271 | 271 |
| |
| 272 | + | |
272 | 273 |
| |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
273 | 284 |
| |
274 | 285 |
| |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
275 | 302 |
| |
| 303 | + | |
276 | 304 |
| |
277 | 305 |
| |
278 | 306 |
| |
| |||
295 | 323 |
| |
296 | 324 |
| |
297 | 325 |
| |
| 326 | + | |
298 | 327 |
| |
299 | 328 |
| |
300 | 329 |
| |
|
src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/Utilities/EnvironmentHelper.cs
Copy file name to clipboardExpand all lines: src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/Utilities/EnvironmentHelper.cs+8-2Lines changed: 8 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
31 | 31 |
| |
32 | 32 |
| |
33 | 33 |
| |
| 34 | + | |
34 | 35 |
| |
35 | 36 |
| |
36 |
| - | |
| 37 | + | |
37 | 38 |
| |
38 | 39 |
| |
39 | 40 |
| |
| |||
182 | 183 |
| |
183 | 184 |
| |
184 | 185 |
| |
185 |
| - | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
186 | 192 |
| |
187 | 193 |
| |
188 | 194 |
| |
|
src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Resources/Base/BuildReleaseArm64XFormsDotNet.apkdesc
Copy file name to clipboardExpand all lines: src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Resources/Base/BuildReleaseArm64XFormsDotNet.apkdesc+56-56Lines changed: 56 additions & 56 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
8 | 8 |
| |
9 | 9 |
| |
10 | 10 |
| |
11 |
| - | |
| 11 | + | |
12 | 12 |
| |
13 | 13 |
| |
14 |
| - | |
| 14 | + | |
15 | 15 |
| |
16 | 16 |
| |
17 |
| - | |
| 17 | + | |
18 | 18 |
| |
19 | 19 |
| |
20 |
| - | |
| 20 | + | |
21 | 21 |
| |
22 | 22 |
| |
23 |
| - | |
| 23 | + | |
24 | 24 |
| |
25 | 25 |
| |
26 | 26 |
| |
27 | 27 |
| |
28 | 28 |
| |
29 |
| - | |
| 29 | + | |
30 | 30 |
| |
31 | 31 |
| |
32 |
| - | |
| 32 | + | |
33 | 33 |
| |
34 | 34 |
| |
35 |
| - | |
| 35 | + | |
36 | 36 |
| |
37 | 37 |
| |
38 |
| - | |
| 38 | + | |
39 | 39 |
| |
40 | 40 |
| |
41 |
| - | |
| 41 | + | |
42 | 42 |
| |
43 | 43 |
| |
44 |
| - | |
| 44 | + | |
45 | 45 |
| |
46 | 46 |
| |
47 |
| - | |
| 47 | + | |
48 | 48 |
| |
49 | 49 |
| |
50 |
| - | |
| 50 | + | |
51 | 51 |
| |
52 | 52 |
| |
53 |
| - | |
| 53 | + | |
54 | 54 |
| |
55 | 55 |
| |
56 |
| - | |
| 56 | + | |
57 | 57 |
| |
58 | 58 |
| |
59 |
| - | |
| 59 | + | |
60 | 60 |
| |
61 | 61 |
| |
62 |
| - | |
| 62 | + | |
63 | 63 |
| |
64 | 64 |
| |
65 |
| - | |
| 65 | + | |
66 | 66 |
| |
67 | 67 |
| |
68 |
| - | |
| 68 | + | |
69 | 69 |
| |
70 | 70 |
| |
71 |
| - | |
| 71 | + | |
72 | 72 |
| |
73 | 73 |
| |
74 |
| - | |
| 74 | + | |
75 | 75 |
| |
76 | 76 |
| |
77 |
| - | |
| 77 | + | |
78 | 78 |
| |
79 | 79 |
| |
80 |
| - | |
| 80 | + | |
81 | 81 |
| |
82 | 82 |
| |
83 |
| - | |
| 83 | + | |
84 | 84 |
| |
85 | 85 |
| |
86 |
| - | |
| 86 | + | |
87 | 87 |
| |
88 | 88 |
| |
89 |
| - | |
| 89 | + | |
90 | 90 |
| |
91 | 91 |
| |
92 |
| - | |
| 92 | + | |
93 | 93 |
| |
94 | 94 |
| |
95 |
| - | |
| 95 | + | |
96 | 96 |
| |
97 | 97 |
| |
98 |
| - | |
| 98 | + | |
99 | 99 |
| |
100 | 100 |
| |
101 |
| - | |
| 101 | + | |
102 | 102 |
| |
103 | 103 |
| |
104 |
| - | |
| 104 | + | |
105 | 105 |
| |
106 | 106 |
| |
107 |
| - | |
| 107 | + | |
108 | 108 |
| |
109 | 109 |
| |
110 |
| - | |
| 110 | + | |
111 | 111 |
| |
112 | 112 |
| |
113 |
| - | |
| 113 | + | |
114 | 114 |
| |
115 | 115 |
| |
116 |
| - | |
| 116 | + | |
117 | 117 |
| |
118 | 118 |
| |
119 |
| - | |
| 119 | + | |
120 | 120 |
| |
121 | 121 |
| |
122 |
| - | |
| 122 | + | |
123 | 123 |
| |
124 | 124 |
| |
125 |
| - | |
| 125 | + | |
126 | 126 |
| |
127 | 127 |
| |
128 | 128 |
| |
129 | 129 |
| |
130 | 130 |
| |
131 |
| - | |
| 131 | + | |
132 | 132 |
| |
133 | 133 |
| |
134 |
| - | |
| 134 | + | |
135 | 135 |
| |
136 | 136 |
| |
137 |
| - | |
| 137 | + | |
138 | 138 |
| |
139 | 139 |
| |
140 |
| - | |
| 140 | + | |
141 | 141 |
| |
142 | 142 |
| |
143 |
| - | |
| 143 | + | |
144 | 144 |
| |
145 | 145 |
| |
146 |
| - | |
| 146 | + | |
147 | 147 |
| |
148 | 148 |
| |
149 |
| - | |
| 149 | + | |
150 | 150 |
| |
151 | 151 |
| |
152 |
| - | |
| 152 | + | |
153 | 153 |
| |
154 | 154 |
| |
155 |
| - | |
| 155 | + | |
156 | 156 |
| |
157 | 157 |
| |
158 |
| - | |
| 158 | + | |
159 | 159 |
| |
160 | 160 |
| |
161 |
| - | |
| 161 | + | |
162 | 162 |
| |
163 | 163 |
| |
164 |
| - | |
| 164 | + | |
165 | 165 |
| |
166 | 166 |
| |
167 |
| - | |
| 167 | + | |
168 | 168 |
| |
169 | 169 |
| |
170 |
| - | |
| 170 | + | |
171 | 171 |
| |
172 | 172 |
| |
173 | 173 |
| |
| |||
239 | 239 |
| |
240 | 240 |
| |
241 | 241 |
| |
242 |
| - | |
| 242 | + | |
243 | 243 |
| |
244 | 244 |
| |
245 |
| - | |
| 245 | + | |
246 | 246 |
| |
247 | 247 |
| |
248 | 248 |
| |
| |||
254 | 254 |
| |
255 | 255 |
| |
256 | 256 |
| |
257 |
| - | |
| 257 | + | |
258 | 258 |
| |
259 | 259 |
| |
260 | 260 |
| |
| |||
2006 | 2006 |
| |
2007 | 2007 |
| |
2008 | 2008 |
| |
2009 |
| - | |
| 2009 | + | |
2010 | 2010 |
|
You can’t perform that action at this time.
0 commit comments