VS 2019 Mac is super fast! Did you actually Improve VS 2019 Mac Pre version?

batmacibatmaci DEMember ✭✭✭✭✭
edited June 18 in Visual Studio

I am not a mac user and started using VS 2019 mac 2 months a go. I have done all my Android releases using VS windows till today.
Release build+archiving takes more than 30mins every time using aot+llvm+bundle into native assemblies+full linking+ split into separate apks+proguard+dex
Yesterday i tried using VS 2019 mac latest Pre version.
Release build was like 2 mins
Installing on my samsung s10+ 5 mins
Archiving apks 10 mins (even maybe less)

Biggest surprise for me was my app size using windows 39mb, mac produced 25mb
App is running fine on my phone without any crash.
I havent tried latest VS2019 windows version yet. maybe same there now. I will try it also as soon as possible to compare.
if you did such big improvement congratulations

PS; my Windows machine is probably 2 times more powerful than my Macbook.

Answers

  • DooksDooks ZAMember ✭✭✭

    I use a Dell G5 (32GB Ram, 512GB SSD, i7) Windows 10, VS2017 latest version
    My compiles are around 1min from clicking debug until it starts on my Samsung S9.

    Do you have an SSD in your windows machine? If not, that is the difference.

  • batmacibatmaci DEMember ✭✭✭✭✭
    edited June 18

    @dooks i am talking about releases. otherwise debugging is fast on both windows and mac machines.
    I have a brand new faster ssd on windows than mac ssd (6 years old).

  • DooksDooks ZAMember ✭✭✭

    @batmaci My release time is a bit longer, around 1m30s

    But yeah, can't really compare a mac machine to your windows machine. All Apple hardware is done by Apple for Apple software. The latencies between RAM/GPU/CPU/HDD read/writes are much less than other machines. All optimized to work together. So Mac is faster with less numbers. As for the VS software differences, you'll have to install the 2019 version on your windows to see what have changed. It is great news that the final APK size is much smaller than older VS.

  • batmacibatmaci DEMember ✭✭✭✭✭

    @Dooks i am always up to date with vs tools. I had tried vs 2019 windows before. it had some aot problem and it was taking even longer than vs2017. thats why i kept vs 2019 and vs 2017 side by side. Used 2019 mostly for debugging on windows because load times are faster than vs 2017 on windows.
    last 2 months i started using vs 2019 mac and it had also a lot of problems. it was even behind vs 2019 windows releases. I created a ticket on their github to complain about it and i was advised to use preview channel on mac.
    this made whole a lot of difference. i am surprised with the performance of vs mac even i am using 6-7 years old mac machine with less power than windows.
    i am not sure if it was always like that. that vs mac been always faster than vs windows. I cannot confirm as i am new on mac also. But remember Xamaarin Studio being better than VS when they both exist until Microsoft acquired Xamarin. Then Xamarin studio was ported on Mac as VS Mac. while windows version is VS only. this could be the difference also.

    1m,30s is extremely good time. you probably dont use settings i mention above or your app is relatively smaller than mine. AOT+LLVM+Bundle into native assemblies multiplies release time.

  • DooksDooks ZAMember ✭✭✭

    @batmaci I dont know what those settings are. Here are my Android settings for release. Debug is the same, just the Enable Developer Intrumentation is also ticked

    Android release

  • batmacibatmaci DEMember ✭✭✭✭✭

    @Dooks you are using basic release settings. thats why your release is fast. You are probably on Community version. it doesnt have UI for those I mentioned but you still can use by changing android.csproj file. see following articles
    https://docs.microsoft.com/en-us/xamarin/android/deploy-test/release-prep/?tabs=windows
    https://xamarinhelp.com/xamarin-android-aot-works/

  • DooksDooks ZAMember ✭✭✭

    @batmaci No I have VS 2017 Pro
    But yes, I didn't compile with those 3 settings enabled.
    Turned all of them on and tried to build. Doesn't build. Probably something else is wrong, but I'm fine with the way it is now and the final APK size. Planning on going native soon anyways, no more struggling with Xamarin.

  • DooksDooks ZAMember ✭✭✭
    edited June 19

    Okay, almost when I gave Up - the settings were saved in the CSProj file (reverted for some reason) and it compiles successfully. 4m30s

    <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
        <AotAssemblies>true</AotAssemblies>
        <EnableLLVM>true</EnableLLVM>
        <BundleAssemblies>true</BundleAssemblies>
        <AndroidEnableMultiDex>false</AndroidEnableMultiDex>
        <EnableProguard>true</EnableProguard>
        <JavaMaximumHeapSize>1G</JavaMaximumHeapSize>
        <EmbedAssembliesIntoApk>true</EmbedAssembliesIntoApk>
        <AndroidLinkMode>SdkOnly</AndroidLinkMode>
    

    The Nuget Packages I use (including self binded libraries) in the project are :

    Android-Job https://github.com/Dooks123/Android-Job-XamarinBinding
    libphonenumber-csharp   //version=8.10.13
    Newtonsoft.Json //version=12.0.2
    Plugin.CurrentActivity  //version=2.1.0.4
    Plugin.Permissions  //version=3.0.0.12
    sqlite-net-pcl  //version=1.5.231
    SQLitePCLRaw.bundle_green   //version=1.1.14
    SQLitePCLRaw.core   //version=1.1.14
    SQLitePCLRaw.lib.e_sqlite3.android  //version=1.1.14
    SQLitePCLRaw.provider.e_sqlite3.android //version=1.1.14
    Xam.Droid.SimpleCropView    //version=1.1.4.2
    Xam.Plugins.Android.ExoPlayer   //version=2.8.8
    Xam.Plugins.Android.ExoPlayer.Core  //version=2.8.8
    Xam.Plugins.Android.ExoPlayer.Dash  //version=2.8.8
    Xam.Plugins.Android.ExoPlayer.Hls   //version=2.8.8
    Xam.Plugins.Android.ExoPlayer.SmoothStreaming   //version=2.8.8
    Xam.Plugins.Android.ExoPlayer.UI    //version=2.8.8
    Xamarin.Android.Arch.Core.Common    //version=1.1.1.1
    Xamarin.Android.Arch.Core.Runtime   //version=1.1.1.1
    Xamarin.Android.Arch.Lifecycle.Common   //version=1.1.1.1
    Xamarin.Android.Arch.Lifecycle.LiveData //version=1.1.1.1
    Xamarin.Android.Arch.Lifecycle.LiveData.Core    //version=1.1.1.1
    Xamarin.Android.Arch.Lifecycle.Runtime  //version=1.1.1.1
    Xamarin.Android.Arch.Lifecycle.ViewModel    //version=1.1.1.1
    Xamarin.Android.Crashlytics //version=2.9.4.1
    Xamarin.Android.Crashlytics.Answers //version=1.4.2
    Xamarin.Android.Crashlytics.Beta    //version=1.2.9
    Xamarin.Android.Crashlytics.Core    //version=2.6.3
    Xamarin.Android.Fabric  //version=1.4.3
    Xamarin.Android.ShortcutBadger  //version=1.1.982
    Xamarin.Android.Support.Animated.Vector.Drawable    //version=28.0.0.1
    Xamarin.Android.Support.Annotations //version=28.0.0.1
    Xamarin.Android.Support.AsyncLayoutInflater //version=28.0.0.1
    Xamarin.Android.Support.Collections //version=28.0.0.1
    Xamarin.Android.Support.Compat  //version=28.0.0.1
    Xamarin.Android.Support.CoordinaterLayout   //version=28.0.0.1
    Xamarin.Android.Support.Core.UI //version=28.0.0.1
    Xamarin.Android.Support.Core.Utils  //version=28.0.0.1
    Xamarin.Android.Support.CursorAdapter   //version=28.0.0.1
    Xamarin.Android.Support.CustomView  //version=28.0.0.1
    Xamarin.Android.Support.Design  //version=28.0.0.1
    Xamarin.Android.Support.DocumentFile    //version=28.0.0.1
    Xamarin.Android.Support.DrawerLayout    //version=28.0.0.1
    Xamarin.Android.Support.Fragment    //version=28.0.0.1
    Xamarin.Android.Support.Interpolator    //version=28.0.0.1
    Xamarin.Android.Support.Loader  //version=28.0.0.1
    Xamarin.Android.Support.LocalBroadcastManager   //version=28.0.0.1
    Xamarin.Android.Support.Media.Compat    //version=28.0.0.1
    Xamarin.Android.Support.Print   //version=28.0.0.1
    Xamarin.Android.Support.SlidingPaneLayout   //version=28.0.0.1
    Xamarin.Android.Support.SwipeRefreshLayout  //version=28.0.0.1
    Xamarin.Android.Support.Transition  //version=28.0.0.1
    Xamarin.Android.Support.v4  //version=28.0.0.1
    Xamarin.Android.Support.v7.AppCompat    //version=28.0.0.1
    Xamarin.Android.Support.v7.CardView //version=28.0.0.1
    Xamarin.Android.Support.v7.RecyclerView //version=28.0.0.1
    Xamarin.Android.Support.Vector.Drawable //version=28.0.0.1
    Xamarin.Android.Support.VersionedParcelable //version=28.0.0.1
    Xamarin.Android.Support.ViewPager   //version=28.0.0.1
    Xamarin.Android.UniversalImageLoader    //version=1.9.5.1
    Xamarin.Build.Download  //version=0.4.11
    Xamarin.Firebase.Analytics  //version=60.1142.1
    Xamarin.Firebase.Analytics.Impl //version=60.1142.1
    Xamarin.Firebase.Common //version=60.1142.1
    Xamarin.Firebase.Iid    //version=60.1142.1
    Xamarin.Firebase.Messaging  //version=60.1142.1
    Xamarin.GooglePlayServices.Analytics    //version=60.1142.1
    Xamarin.GooglePlayServices.Analytics.Impl   //version=60.1142.1
    Xamarin.GooglePlayServices.Base //version=60.1142.1
    Xamarin.GooglePlayServices.Basement //version=60.1142.1
    Xamarin.GooglePlayServices.Gcm  //version=60.1142.1
    Xamarin.GooglePlayServices.Iid  //version=60.1142.1
    Xamarin.GooglePlayServices.TagManager.V4.Impl   //version=60.1142.1
    Xamarin.GooglePlayServices.Tasks    //version=60.1142.1
    

    With settings Enabled:

    • Clean&Archive time: 4m31s
    • APK output size: 76.6MB
    • App startup time before splash screen: around 250ms

    Without settings Enabled:

    • Clean&Archive time: 1m49s
    • APK output size: 45.5MB
    • App startup time before splash screen: around 500ms

    I do notice in the app with the settings enabled, it sometimes jerks a lot - I don't know if it is how the native compiled mono libraries act? It feels smoother in app without the settings, albeit a little longer startup time. Think the only way to get it as smooth as apps like WhatsApp would be to go native. Redo everything in Java. Things I'm missing in Xamarin are the disk cache libraries, latest updates of Google Libraries, the startup time is not good, the final APK sizes are not good, and speed difference in RecyclerView for example is not good at all. Xamarin is also always behind with new features such as the app bundling.

    This was a nice experience, but luckily I could convince my Managers of a rewrite in Java.

    Things I do like in C# - code re-usability, Actions, Events, SQLite library from Frank A. Krueger + Linq & Lambda and the way objects are quickly built. C# Mono is very nice to develop in, but for a final product, not the best outcome.

Sign In or Register to comment.