-
Notifications
You must be signed in to change notification settings - Fork 551
Runtime Performance Ideas
Runtime performance is important for our users. We care about the startup performance and also the performance in general.
Type of measurements we use to analyze the runtime performance
-
Profiler - we use manual measurements with profiler to analyze the performance of the managed code. Usually the calls, alloc and sample reports.
- NDK native profiler can be used to profile Mono + Xamarin.Android native runtimes
-
New JNI marshal methods to speedup startup by avoiding System.Reflection.Emit use. That would hopefully provide faster marshal methods registration and reduce the JIT time and apk size
-
Profiled AOT - the idea is to AOT just the startup code to make apk size smaller, while preserve fast startup. (AOT startup is about 2 times faster)
-
Run some of the regular tests with profiling. Process and use the data in the time plots
-
Assemblies loading
- do not try to load AOT'ed assemblies when we know they are not in the apk (Release configuration)
- Let Mono know where it can look for assemblies in general (e.g. skip the GAC, skip compile time host locations). We know exactly where the assemblies may be. This would limit calls to
monodroid_dlopen
anddlopen
-
Measure performance regularly on devices as well - today we only use Android emulator to run the tests by the build bots. It might be also worth to run performance measurements on dedicated machine and collect data on mobile devices and emulators. That might be more stable compared to the build bots.
-
Improve the way we use the
typemap.{jm,mj}
files. Currently they use thebsearch
andstrcmp
to compare strings, thus recalculating string hashes continuously and the lookup function is called very often. It might be faster to enhance the typemap format with a precalculated hash of the string and then use anint -> typemap_entry
dictionary/map to cut the number of hash calculations in half. With C++ we could use for instance sparsehash to make the comparisons faster than they are now.
-
Fix Bcl test measurements and add them to the plots again
-
Generate and use JNI marshal methods for constructors used in the ConstructorBuilder to avoid last System.Reflection.Emit use
- APK Tests on the Hyper V Emulator
- Design Time Build System
- Profile MSBuild Tasks
- Diagnose Fast Deployment Issues
- Preview layout XML files with Android Studio
- Documentation