Update Android NDK and set optimization flags (#68354)
Brings in new cmake 2.23.1 and Android NDK23c which fixes an issue with the binary size and perf of libmonosgen-2.0.so In NDK23b they decided to no longer pass -O2 compiler optimization flag (for arm64, armv7 used -Oz) as part of the Android toolchain but delegate to upstream CMake behavior: https://github.com/android/ndk/wiki/Changelog-r23 and https://github.com/android/ndk/issues/1536 CMake defaults to -O3 for Release builds but unfortunately this causes quite a noticable binary size increase and perf regression. The Xamarin Android team measured startup time on an average of 10 runs of `dotnet new maui` on a Pixel 5: ``` -O3: 893.7ms -O2: 600.2ms -Oz: 649.1ms ``` We now explicitly pass in -O2 for Android builds. Fixes https://github.com/dotnet/runtime/issues/68330
Showing
想要评论请 注册 或 登录