Xamarin Forms: Tappable Label vs Button, Which has better performance?

Azrin Sani 116 Reputation points
2021-05-09T07:51:24.557+00:00

Hi,

I'm trying to optimize my Xamarin Forms app. We are implementing a Collection View with a lot of items.

One of the fundamentals of the collection view itemtemplate is that they will have a few buttons. I'm wondering what is the more performant path? To use buttons or tappable label?

Thanks

Xamarin
Xamarin
A Microsoft open-source app platform for building Android and iOS apps with .NET and C#.
4,818 questions
No comments
{count} votes

Accepted answer
  1. Azrin Sani 116 Reputation points
    2021-05-10T03:26:59.047+00:00

    I actually did a lot of tests on various devices from old to new. I can confirm with 100% certainty that having simple labels with gestures is 100% more performant!!

    Buttons take more memory, causes janks, and slower start time.

    This is for Android though, I have yet to test on iOS.

    No comments

1 additional answer

Sort by: Most helpful
  1. 2021-05-10T02:31:03.26+00:00

    Hello,

    Welcome to Microsoft Q&A!

    It's hard to say which has better performance , however I would suggest you take a look at Xamarin Profiler .

    The Xamarin Profiler has a number of instruments available for profiling — Allocations, Cycles, and Time Profiler.

    Profiling helps developers to figure out where most of the time is spent in your application, and how memory is used by your application.

    For first of all , you will need to be a Visual Studio Enterprise subscriber to unlock this feature in either Visual Studio Enterprise on Windows or Visual Studio for Mac on a Mac.

    Best Regards,
    Cole Xia


    If the response is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.