Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/sdks
diff options
context:
space:
mode:
authorJonathan Peppers <jonathan.peppers@gmail.com>2019-12-04 13:50:59 +0300
committerAlexander Köplinger <alex.koeplinger@outlook.com>2019-12-04 13:50:59 +0300
commitb816189b947ab590e82509f6eb6130546927c988 (patch)
tree083612cb48b0bb470812b5bde17a3e4f8fe2cf17 /sdks
parenta79c4d11a4ce69c6a79ff21778bf308809d36988 (diff)
[android] don't probe directories for .config files (#18024)
* [android] don't probe directories for .config files In Xamarin.Android, on startup we see logging like this for every .NET assembly: 12-03 14:27:42.104 26842 26842 D Mono : Prepared to set up assembly 'FormsViewGroup' (/storage/emulated/0/Android/data/Xamarin.Forms_Performance_Integration/files/.__override__/FormsViewGroup.dll) 12-03 14:27:42.104 26842 26842 D Mono : Assembly FormsViewGroup[0xebcee9c0] added to domain RootDomain, ref_count=1 12-03 14:27:42.104 26842 26842 D Mono : Assembly Loader loaded assembly from location: '/storage/emulated/0/Android/data/Xamarin.Forms_Performance_Integration/files/.__override__/FormsViewGroup.dll'. 12-03 14:27:42.104 26842 26842 D Mono : Config attempting to parse: '/storage/emulated/0/Android/data/Xamarin.Forms_Performance_Integration/files/.__override__/FormsViewGroup.dll.config'. 12-03 14:27:42.104 26842 26842 D Mono : Config attempting to parse: '/Users/builder/jenkins/workspace/archive-mono/2019-10/android/release/sdks/out/android-x86-release/etc/mono/assemblies/FormsViewGroup/FormsViewGroup.config'. In most cases, no `.dll.config` file exists and so it probes this macOS-looking path: /Users/builder/jenkins/workspace/archive-mono/2019-10/android/release/sdks/out/android-x86-release/etc/mono/assemblies/FormsViewGroup/FormsViewGroup.config It looks like this is happening because nothing in Xamarin.Android calls `mono_set_dirs` or `mono_set_config_dir` and so it falls back to using `MONO_CFG_DIR`. `MONO_CFG_DIR` is set to a path on the build machine. Even if Xamarin.Android *did* call `mono_set_config_dir`, the code appends `mono/assemblies`: cfg = g_build_filename (cfg_dir, "mono", "assemblies", aname, cfg_name, (const char*)NULL); So it doesn't seem useful to use this fallback at all, there would never be a file found. I wrapped the appropriate code in `#ifndef TARGET_ANDROID` blocks. I was able to see a minor *maybe* ~20ms performance improvement on startup: Before: 12-03 14:27:48.494 26903 26903 I monodroid-timing: Runtime.init: end, total time; elapsed: 0s:601::443900 12-03 14:27:54.356 26963 26963 I monodroid-timing: Runtime.init: end, total time; elapsed: 0s:587::495400 12-03 14:28:00.263 27021 27021 I monodroid-timing: Runtime.init: end, total time; elapsed: 0s:586::147100 12-03 14:28:06.135 27074 27074 I monodroid-timing: Runtime.init: end, total time; elapsed: 0s:593::639100 12-03 14:28:11.988 27129 27129 I monodroid-timing: Runtime.init: end, total time; elapsed: 0s:571::194900 After: 12-03 14:46:50.590 27737 27737 I monodroid-timing: Runtime.init: end, total time; elapsed: 0s:503::918700 12-03 14:46:56.517 27794 27794 I monodroid-timing: Runtime.init: end, total time; elapsed: 0s:570::533600 12-03 14:47:02.368 27850 27850 I monodroid-timing: Runtime.init: end, total time; elapsed: 0s:537::435000 12-03 14:47:08.289 27904 27904 I monodroid-timing: Runtime.init: end, total time; elapsed: 0s:587::830900 12-03 14:47:14.130 27965 27965 I monodroid-timing: Runtime.init: end, total time; elapsed: 0s:555::593400 This was the Xamarin.Forms integration project in xamarin-android. Running a `Debug` build on a HAXM x86 emulator on Windows. https://github.com/xamarin/xamarin-android/tree/master/tests/Xamarin.Forms-Performance-Integration * Add --enable-minimal=cfgdir_config * This also defines `DISABLE_CFGDIR_CONFIG` * Used this setting for android
Diffstat (limited to 'sdks')
-rw-r--r--sdks/builds/android.mk2
1 files changed, 1 insertions, 1 deletions
diff --git a/sdks/builds/android.mk b/sdks/builds/android.mk
index db488ed208c..152b5e6ab27 100644
--- a/sdks/builds/android.mk
+++ b/sdks/builds/android.mk
@@ -141,7 +141,7 @@ _android-$(1)_CONFIGURE_FLAGS= \
--disable-nls \
--enable-dynamic-btls \
--enable-maintainer-mode \
- --enable-minimal=ssa,portability,attach,verifier,full_messages,sgen_remset,sgen_marksweep_par,sgen_marksweep_fixed,sgen_marksweep_fixed_par,sgen_copying,logging,security,shared_handles,interpreter,gac \
+ --enable-minimal=ssa,portability,attach,verifier,full_messages,sgen_remset,sgen_marksweep_par,sgen_marksweep_fixed,sgen_marksweep_fixed_par,sgen_copying,logging,security,shared_handles,interpreter,gac,cfgdir_config \
--enable-monodroid \
--with-btls-android-ndk=$$(ANDROID_TOOLCHAIN_DIR)/ndk \
--with-btls-android-api=$$(ANDROID_SDK_VERSION_$(1)) \