0

This may be too open ended for SO, but I've reached a point where if I can't resolve this then I need to redo weeks of work.

I've manually converted an existing Xamarin app to MAUI, and found that there is a noticable performance penalty across the entire app.

Examples:

  • Text resources pop-in several seconds after a view is displayed (Edit: after checking, this is actually related to a value being read from secure storage, so file under I/O slowness)
  • UI animations/transitions that were previously smooth or instant noticably hitch
  • Actions that involve I/O are seemingly slower

I still have the Xamarin app for reference, and the view models and logic are 99% the same. The views are also mostly the same, aside from any elements that were removed or renamed.

Another wrinkle is that performance is much better in the Android emulator than on the device.

Is there a difference between Xamarin and MAUI that I'm overlooking? Is there a build setting that could be impacting the app's performance? Any advice is appreciated.

6
  • LOL. That is the first time I heard that the emulator works better than a real device... What test devices (model, manufacturer) have you used. DO you build an universal APK for different platforms? What platforms are enabled or filtered out for that APK? Commented Jul 17 at 17:31
  • @Robert Performance is what I'd expect on the emulator, is closer to what I mean. It currently only targets Android. Commented Jul 17 at 18:37
  • 1
    It is very open-ended; if you'd like, you can reach out to me and we can discuss this at length. Commented Jul 17 at 20:23
  • @FreakyAli I'd appreciate that, how can I reach you? Commented Jul 18 at 8:40
  • 1
    Debug or Release? MAUI uses advanced debugging features such as Hot Reload, which can have a noticeable performance impact. I'm sure Ali can help you figure this out. Commented Jul 18 at 12:13

1 Answer 1

1

Some of the issues have turned out to be unrelated to each other. I think the page animation issue is related to the MVVM framework I'm using.

However, the answer to the question of what is slower between Xamarin and MAUI, in this case, is SecureStorage.

This is a github issue (https://github.com/dotnet/maui/issues/18817) regarding SecureStorage calls that don't resolve in the App constructor (which has nothing to do with my issues as far as I know). Further down the discussion there are some posts that mention the poor performance of SecureStorage.GetAsync. So far, I've seen marked improvements in areas where (admittedly because of laziness) a GetAsync call was on a hot path. This issue also seems to explain why the MAUI performance in the emulator was similar to Xamarin, as opposed to on the physical device, in addition to only affecting Android.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.