Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[monodroid] don't probe for .exe files (#3958)
I was noticing a lot of logging like this: I monodroid-assembly: open_from_update_dir: trying to open assembly: /data/user/0/com.xamarin.android.helloworld/files/.__override__/mscorlib.dll I monodroid-assembly: open_from_update_dir: trying to open assembly: /storage/emulated/0/Android/data/com.xamarin.android.helloworld/files/.__override__/mscorlib.dll I monodroid-assembly: open_from_update_dir: trying to open assembly: /data/user/0/com.xamarin.android.helloworld/files/.__override__/mscorlib.dll.dll I monodroid-assembly: open_from_update_dir: trying to open assembly: /storage/emulated/0/Android/data/com.xamarin.android.helloworld/files/.__override__/mscorlib.dll.dll I monodroid-assembly: open_from_update_dir: trying to open assembly: /data/user/0/com.xamarin.android.helloworld/files/.__override__/mscorlib.dll.exe I monodroid-assembly: open_from_update_dir: trying to open assembly: /storage/emulated/0/Android/data/com.xamarin.android.helloworld/files/.__override__/mscorlib.dll.exe I monodroid-assembly: open_from_bundles: looking for bundled name: 'mscorlib.dll' D Mono : Image addref mscorlib[0x7f74876f3f00] (asmctx DEFAULT) -> mscorlib.dll[0x7f747fb32000]: 2 A couple things we could do here is: 1. Don't probe for `.exe` files at all. We don't even consider `.exe` files at build time anymore as of e390702. 2. Check if the name ends with `.dll` to decide if `.dll` should be appended when probing. This change is needed in both `open_from_update_dir()` and `open_from_bundles()`. Now the probing is cut down to: I monodroid-assembly: open_from_update_dir: trying to open assembly: /data/user/0/com.xamarin.android.helloworld/files/.__override__/mscorlib.dll I monodroid-assembly: open_from_update_dir: trying to open assembly: /storage/emulated/0/Android/data/com.xamarin.android.helloworld/files/.__override__/mscorlib.dll I monodroid-assembly: open_from_bundles: looking for bundled name: 'mscorlib.dll' D Mono : Image addref mscorlib[0x7f74876f2f80] (asmctx DEFAULT) -> mscorlib.dll[0x7f747fb33000]: 2 ~~ Results ~~ Using the `samples\HelloWorld` app in this repo, on a Pixel 3 XL: * Before: I monodroid-timing: Runtime.init: end, total time; elapsed: 0s:165::704288 I monodroid-timing: Runtime.init: end, total time; elapsed: 0s:165::558089 I monodroid-timing: Runtime.init: end, total time; elapsed: 0s:165::936683 I monodroid-timing: Runtime.init: end, total time; elapsed: 0s:164::536735 I monodroid-timing: Runtime.init: end, total time; elapsed: 0s:166::357204 * After: I monodroid-timing: Runtime.init: end, total time; elapsed: 0s:165::597673 I monodroid-timing: Runtime.init: end, total time; elapsed: 0s:164::106162 I monodroid-timing: Runtime.init: end, total time; elapsed: 0s:164::997516 I monodroid-timing: Runtime.init: end, total time; elapsed: 0s:164::931683 I monodroid-timing: Runtime.init: end, total time; elapsed: 0s:164::95381 My guess is this is a 1-2ms improvement on this device. So then I tried an x86 emulator using HAXM: * Before: I monodroid-timing: Runtime.init: end, total time; elapsed: 0s:501::511300 I monodroid-timing: Runtime.init: end, total time; elapsed: 0s:545::571100 I monodroid-timing: Runtime.init: end, total time; elapsed: 0s:555::89900 I monodroid-timing: Runtime.init: end, total time; elapsed: 0s:541::920000 I monodroid-timing: Runtime.init: end, total time; elapsed: 0s:509::316700 * After: I monodroid-timing: Runtime.init: end, total time; elapsed: 0s:472::543900 I monodroid-timing: Runtime.init: end, total time; elapsed: 0s:446::208700 I monodroid-timing: Runtime.init: end, total time; elapsed: 0s:469::216400 I monodroid-timing: Runtime.init: end, total time; elapsed: 0s:420::160500 I monodroid-timing: Runtime.init: end, total time; elapsed: 0s:437::225200 Here the improvement might be more like 50-75ms. I will probably focus on timing the HAXM emulator from now on, since I am focusing on improving the developer loop here.
- Loading branch information