Skip to content

Weird performance behaviour differences in my app between the Xamarin.Android build as compared to the Net7 build #8285

@gmck

Description

@gmck

Android application type

.NET Android (net7.0-android, etc.)

Affected platform version

VS 2022 17.7.0 Prev 6.0

Description

I have the following results of start-up time (displayed value) via LogCat.

X.A. Build Net7 Build

  1. 512ms 1. 497ms
  2. 421ms 2. 441ms
  3. 440ms 3. 434ms
  4. 417ms 4. 440ms
    Average 447ms Average 453ms

At this point, you’d have to say the start-up performance of both apps is about the same. When navigating from fragment to fragment and generally just exploring the features of the app, they appear to be very similar with good performance.

However, until a user is signed in via a GoogleSignIn fragment, there isn’t any real functionality that can be tested because until the user is signed in, they can’t really do much other than explore the various screens (fragments) via the NavigationView and the 3 dot menu of the StartDestination fragment.

The following are the results after the completion of the GoogleSignIn. After a successful sign in the relevant data is saved to SharedPreferences. The code of the GoogleSignIn fragment is identical in each build.

Pixel 7
X.A. Build Net7 Build

  1. 618ms 1.419
  2. 467ms 1.335
  3. 623ms 1.332
  4. 611ms 1.341
    Average 579ms 1.356

That’s a difference of nearly 0.8 sec, which is extremely noticeable when navigating between fragments etc. as compared to the X.A. version. There is a general feeling of sluggishness in the Net7 app after selecting any menuItem of NavigationView and then waiting for the new fragment to appear.

If you refer to my final comment in #8239 you’ll find the aab sizes and build times listed there. The displayed times there are very similar to this latest test. The only downer there is that the Build time for the release version takes considerably longer for the Net7 build – close to 2 minutes longer than the X.A. build.

I’ve also run the same test on a Pixel 6 and Samsung S7 tablet and the behaviour of the Net7 build is the same as above.
I’m hoping you guys may have an explanation or suggestions for improving the Net7 build. If you need any build logs etc I’ll attach them here, but it seems like some type of runtime problem and I’m wondering what could be used to help track this problem.

Steps to Reproduce

N/A

Did you find any workaround?

No

Relevant log output

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions