Skip to content

StackLayout performance degrades in .NET MAUI (1s) vs Xamarin (0.5s) with 100+ labels in Release Mode #30721

@PleatMan

Description

@PleatMan

Description

We’re seeing a significant performance difference in page creation time between Xamarin and MAUI, resulting in what feels like a freeze when navigating pages — a very noticeable and not user-friendly experience.

🎥 https://youtube.com/shorts/MTms2MMd4Yc

Background

Due to Xamarin being deprecated and mobile platform requirements for updated SDKs, we were forced to migrate to MAUI. After years of effort refining our Xamarin app, MAUI has unfortunately felt like starting over.

After migrating our production app to MAUI (initially v8, now v9), we noticed that each page creation takes 2–3 seconds — which is an unacceptable user experience and would be a noticeable regression for our existing Xamarin users.

We initially suspected something in our app, but after extensive testing and community research, we created a controlled sample app and were able to confirm the same performance issue.

Test Setup

We created identical apps in Xamarin and MAUI with 3 pages:

  • Page 1 → 100 bindings
  • Page 2 → 200 bindings
  • Page 3 → 300 bindings

Each test logs:

  • InitializeComponent time
  • ViewModel creation/binding
  • OnAppearing execution time

Devices tested:

  • iPhone 11 – iOS 18.5
  • Xiaomi 12 – Android 13
  • Samsung M31 – Android 14

Performance Comparison

Quick overview

Phone App Log line Page 1 Page 2 Page 3
iPhone 11 Xamarin OnAppearing total time 112 ms 147 ms 188 ms
iPhone 11 MAUI OnAppearing total time 820 ms 1551 ms 2300 ms
Xiaomi 12 Xamarin OnAppearing total time 240 ms 348 ms 501 ms
Xiaomi 12 MAUI OnAppearing total time 683 ms 1193 ms 1533 ms
Samsung M31 Xamarin OnAppearing total time 691 ms 790 ms 1078 ms
Samsung M31 MAUI OnAppearing total time 1691 ms 2609 ms 3659 ms
Detailed data table

Detailed data table

Phone Page Log line Xamarin MAUI
iPhone 11 Page 1 InitializeComponent 12 ms 317 ms
iPhone 11 Page 1 OnAppearing time 91 ms 486 ms
iPhone 11 Page 1 OnAppearing total time 112 ms 820 ms
iPhone 11 Page 2 InitializeComponent 26 ms 622 ms
iPhone 11 Page 2 OnAppearing time 113 m 905 ms
iPhone 11 Page 2 OnAppearing total time 147 ms 1551 ms
iPhone 11 Page 3 InitializeComponent 28 ms 930 ms
iPhone 11 Page 3 OnAppearing time 152 ms 1336 ms
iPhone 11 Page 3 OnAppearing total time 188 ms 2300 ms
Xiaomi 12 Page 1 InitializeComponent 36 ms 363 ms
Xiaomi 12 Page 1 OnAppearing time 188 ms 301 ms
Xiaomi 12 Page 1 OnAppearing total time 240 ms 683 ms
Xiaomi 12 Page 2 InitializeComponent 58 ms 665 ms
Xiaomi 12 Page 2 OnAppearing time 270 m 503 ms
Xiaomi 12 Page 2 OnAppearing total time 348 ms 1193 ms
Xiaomi 12 Page 3 InitializeComponent 103 ms 930 ms
Xiaomi 12 Page 3 OnAppearing time 367 ms 561 ms
Xiaomi 12 Page 3 OnAppearing total time 501 ms 1533 ms
Samsung M31 Page 1 InitializeComponent 96 ms 944 ms
Samsung M31 Page 1 OnAppearing time 537 ms 697 ms
Samsung M31 Page 1 OnAppearing total time 691 ms 1691 ms
Samsung M31 Page 2 InitializeComponent 170 ms 1604 ms
Samsung M31 Page 2 OnAppearing time 536 m 946 ms
Samsung M31 Page 2 OnAppearing total time 790 ms 2609 ms
Samsung M31 Page 3 InitializeComponent 225 ms 2245 ms
Samsung M31 Page 3 OnAppearing time 727 m 1316 ms
Samsung M31 Page 3 OnAppearing total time 1078 ms 3659 ms

Repository & Resources

🔗 GitHub repo (sample project):
https://github.com/PleatMan/MauiOpenPagePerformanceIssue

🔍 Speedscope traces:

📦 Ready-to-test APKs:

If others want to help test, please post your results and phone/OS details in the comments.

Sample Code Snippet

public partial class Page1 : ContentPage
{
....
    protected override async void OnAppearing()
    {
        base.OnAppearing();

        // Give the UI time to render before stopping the stopwatch
        await Task.Delay(50); // Optional but helps with accuracy

        _stopWatch.Stop();
        _stopWatchTotal.Stop();

        _viewModel.PageOnAppearingTime = $"Page OnAppearing time: {_stopWatch.ElapsedMilliseconds} ms";
        _viewModel.PageOnAppearingTotalTime =  $"Page OnAppearing total time: {_stopWatchTotal.ElapsedMilliseconds} ms";
    }
}

Full code

Final Thoughts

Huge thanks to @Nikita for the amazing work on DotNet.Meteor. It allowed us to include the profiling.

🙏 And thank you @jfversluis, your youtube channel has been instrumental throughout our MAUI journey.

We’re hopeful this issue will gain traction — and that a performance fix can be prioritised. Let us know if any more diagnostics or logs are needed.

Steps to Reproduce

  1. Install Xamarin App
  2. Open App and tap on menu for each page and note the timings reported
  3. Install Maui app
  4. Open app and tap on menu for each page and note the timings reported

Expected result: Timings to be similar
Actual result: Maui App timings are much slower than the Xamarin App

Link to public reproduction project repository

https://github.com/PleatMan/MauiOpenPagePerformanceIssue

Version with bug

9.0.90 SR9

Is this a regression from previous behavior?

Yes, this used to work in Xamarin.Forms

Last version that worked well

Unknown/Other

Affected platforms

iOS, Android

Affected platform versions

iOS 18.5, Android 13, Android 14

Did you find any workaround?

No

Relevant log output

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-controls-labelLabel, Spanperf/generalThe issue affects performance (runtime speed, memory usage, startup time, etc.) (sub: perf)t/bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions