Commit 57de175
committed
[Java.Interop.Tools.Cecil] use MemoryMappedFile in DirectoryAssemblyResolver
Context: dotnet/linker#1130
Context: https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1783420
In dotnet/linker#1130, their version of `DirectoryAssemblyResolver`
was reworked to use `MemoryMappedFile` in the .NET 6 timeframe. This
commit ports these changes here, as we have MSBuild tasks in
xamarin/xamarin-android that use `DirectoryAssemblyResolver`.
Primarily, the `<GenerateJavaStubs />` MSBuild task uses
`DirectoryAssemblyResolver` to iterate over types in assembly to emit
Java source code and generate `AndroidManifest.xml`.
The results of these changes in a `dotnet new maui` project, an
initial clean build:
GenerateJavaStubs = 1.318 s, 1 calls.
GenerateJavaStubs = 1.254 s, 1 calls.
Saving ~64ms or about ~5% in this example.
The current version of the linker's resolver in .NET 8+ has moved to
the dotnet/runtime repo at:
https://github.com/dotnet/runtime/blob/cd7d006030a7feace9076fa275fb5bffc1bf4a90/src/tools/illink/src/linker/Linker/AssemblyResolver.cs1 parent 07d5595 commit 57de175
File tree
1 file changed
+30
-2
lines changed- src/Java.Interop.Tools.Cecil/Java.Interop.Tools.Cecil
1 file changed
+30
-2
lines changedLines changed: 30 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| 35 | + | |
35 | 36 | | |
36 | 37 | | |
37 | 38 | | |
| |||
61 | 62 | | |
62 | 63 | | |
63 | 64 | | |
| 65 | + | |
64 | 66 | | |
65 | 67 | | |
66 | 68 | | |
| |||
103 | 105 | | |
104 | 106 | | |
105 | 107 | | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
106 | 112 | | |
107 | 113 | | |
108 | 114 | | |
| |||
160 | 166 | | |
161 | 167 | | |
162 | 168 | | |
163 | | - | |
| 169 | + | |
164 | 170 | | |
165 | 171 | | |
166 | 172 | | |
167 | 173 | | |
168 | 174 | | |
169 | 175 | | |
170 | | - | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
171 | 199 | | |
172 | 200 | | |
173 | 201 | | |
| |||
0 commit comments