Improving Performance with Baseline Profiles - MAD Skills

Sdílet
Vložit
  • čas přidán 17. 08. 2024
  • With this episode of MAD Skills we continue with our performance series of videos. In this video you’ll learn about how to improve performance of your app using Baseline Profiles. Android Developer Relations Engineer Tomáš Mlynarič describes what Baseline Profiles are, how to generate them for your app and how to measure the effectiveness of using them.
    Baseline Profiles guidance → goo.gle/3QCXVI3
    Baseline Profiles Codelab → goo.gle/baseli...
    Improving Performance → goo.gle/3QpaerK
    Performance Samples → goo.gle/3SHxYsK
    Watch more MAD Skills episodes → goo.gle/madskills
    Catch more videos on Performance → goo.gle/perfor...
    Subscribe to Android Developers → goo.gle/Androi...
    #Featured #Performance #MADSkills
  • Věda a technologie

Komentáře • 43

  • @user-ks4ki1ww1d
    @user-ks4ki1ww1d Před rokem +1

    Tried implementing Baseline profiles for Android TV but it throws below error saying not yet supported in Android TV. May I know when will this be supported?
    Cause: androidTVApi31 has a device profile of Android TV.
    Wear, TV and Auto devices are presently not supported with Gradle Managed Devices.

  • @tomasschwarz3669
    @tomasschwarz3669 Před 2 lety +3

    Thanks! Can You provide more episodes of MAD Skills?

    • @AndroidDevelopers
      @AndroidDevelopers  Před 2 lety +1

      Hi Tomas! You can check out the MAD Skills playlist here: goo.gle/MAD-Playlist

  • @SuRPuiSSe
    @SuRPuiSSe Před rokem +2

    So to have an app using jetpack compose and running smoothly as an app using xml, we have to do all of this ? it look's like it's evolving, just backwards.

  • @user-sd9fd6wy6o
    @user-sd9fd6wy6o Před rokem

    I am seeing improvements in startup time using macro benchmark tool. But when I am trying to side load it and then taking out numbers. I am not seeing any improvements. Any reason why?
    Or how can I check whether the profile is getting used or not.

  • @andreiverdes
    @andreiverdes Před rokem +1

    Hi! Awesome work! Could this just be a part of the default generating the app bundle flow? Just have to have a device connected when generating the aab...

  • @YashNagayach
    @YashNagayach Před rokem

    I implemented baseline profile in my app, it is showing some improvement when we run benchmark, but no improvement I can see on play console numbers for cold startup time. Any idea?

  • @brentmcd12
    @brentmcd12 Před 2 lety +3

    this should be good to see the results for Chromebook apps when an app loads and performs well as exspected will use it more often where as if it has issues it's more of a turn off after time after time not improving 💻

  • @honglamvuthuy9674
    @honglamvuthuy9674 Před 2 lety +1

    information very good

    • @AndroidDevelopers
      @AndroidDevelopers  Před 2 lety

      Thanks for the love, Hong. You can check out even more MAD Skills episodes with the playlist here: goo.gle/madskills 😁

  • @realcrys
    @realcrys Před rokem +1

    I'm using this on my compose Wear OS app and it makes a huge difference in start up time. I'm now also trying to bring it to the phone app but struggle a bit with state, maybe somebody can point me into a direction. I want to have a critical screen in the baseline profiles which has a lot of unique code and is quite heavy, but to get there I need to log in. As far as I see, there is no way for me to inject a state into the app as benchmark and app are fully separate, so I need to use UiAutomator to log in?

    • @keyboardsurfer
      @keyboardsurfer Před rokem +1

      I'm glad to hear your feedback and happy that you see Baseline Profiles making a difference for you. You can either use UiAutomator or create an intent which comes with a demo user credential which allows you to run through the critical path.

    • @realcrys
      @realcrys Před rokem +2

      @@keyboardsurfer I didn't consider using Intents, that's a good approach. I added now two Intent extras, one to log the user in and one to reset the app. Works great :)

    • @cameronbateau6510
      @cameronbateau6510 Před 3 měsíci

      How many user credentials keep things the same?

  • @anxuan565
    @anxuan565 Před 2 lety +2

    Thanks for many interesting knowledge

    • @AndroidDevelopers
      @AndroidDevelopers  Před 2 lety

      We're happy to hear you enjoyed the video 😀
      Be sure to check out more episodes of MAD Skills right here:
      goo.gle/madskills

  • @user-pm5pe7oc2f
    @user-pm5pe7oc2f Před 2 lety

    nice practice lesson

    • @AndroidDevelopers
      @AndroidDevelopers  Před 2 lety

      We really appreciate your kind feedback! So glad you enjoyed the tutorial 😎
      Be sure to check out more MAD Skills episodes right here:
      goo.gle/madskills

  • @roadsoft8425
    @roadsoft8425 Před 5 měsíci

    I'm curious why is not make this performance improvements by default?
    Google Android SDK developers creates extra complexity for andorid developers around the world.
    Consider this post as my personal butthurt acquired over the years of andorid development

  • @surajvaishnav3253
    @surajvaishnav3253 Před rokem

    getting this error:
    * What went wrong:
    Task 'pixel2Api31BenchmarkAndroidTest' not found in project ':benchmark'.

    • @mlykotom
      @mlykotom Před rokem

      This feature is available in Android Gradle PLugin 7.3.0 and higher, so pls update.

    • @Sok4h
      @Sok4h Před rokem

      Any solution to this? I have AGP 8.0

  • @Vemu
    @Vemu Před 2 lety +1

    Is it possible to do on Flutter?

    • @mlykotom
      @mlykotom Před rokem +1

      Unfortunately it won't work for other frameworks (Flutter, React Native, etc), because these are compiled differently than native Android apps.
      AFAIK Flutter apps in release mode are fully AOT pre-compiled, so you should get good performance out of the box.

  • @user-bg1do8uv9y
    @user-bg1do8uv9y Před rokem

    Thank you for sharing your knowledge 🙏 Of the masterpieces of the mobile industry, I am attracted to social networks: Facebook, Instagram, TikTok, CZcams and others..!😍
    I dream of giving the world a social network too. 🙏
    And I want to understand the nuances of building social networks from the inside! 🤓
    I have already taken online video lessons: Java course for beginners and advanced. I took a lesson on Kotlin, Android lessons for beginners. I have just started taking your MVVM course.
    And I see a bunch of other technologies…. that are posted on the Android developer vacancy… that I need to master for another two or three years for sure 🙏
    And I have not yet come to understand how social networks are built. 🥺
    Can you please advise something, what should I pay attention to in order to learn how to make social networks for native Android development?

  • @PetrSvobodnik
    @PetrSvobodnik Před rokem +1

    We did exact setup but when we run ./gradlew :benchmark:pixel2Api31BenchmarkAndroidTest -P android.testInstrumentationRunnerArguments.androidx.benchmark.enabledRules=BaselineProfile
    it fails
    Starting 3 tests on pixel2Api31
    benchmark.BaselineProfileGenerator > generate[pixel2Api31] FAILED
    java.lang.IllegalArgumentException: Baseline Profile Collection requires a rooted device, and a rooted adb session. Use `adb root`.
    at androidx.benchmark.macro.BaselineProfilesKt.collectBaselineProfile(BaselineProfiles.kt:45)
    benchmark.StartupBenchmark > startupNoCompilation[pixel2Api31] FAILED
    java.lang.AssertionError: ERRORS (not suppressed): NOT-PROFILEABLE
    WARNINGS (suppressed):
    benchmark.StartupBenchmark > startupBaselineProfile[pixel2Api31] FAILED
    java.lang.AssertionError: ERRORS (not suppressed): NOT-PROFILEABLE
    WARNINGS (suppressed):
    Tests on pixel2Api31 failed: There was 3 failure(s).

    • @mlykotom
      @mlykotom Před rokem

      Pls make sure you use the latest (stable) versions for AGP - 7.3.1, Macrobenchmark 1.1.0 and Profile Installer 1.2.0.
      It looks like the library doesn't take into account the enabledRules argument - it was added in 1.1.0-rc02.

    • @YashNagayach
      @YashNagayach Před rokem

      I implemented baseline profile in my app(Using latest versions), it is showing some improvement when we run benchmark, but no improvement I can see on play console numbers for cold startup time. Any idea?

  • @kshih1416
    @kshih1416 Před 4 měsíci

    is it outdated?

  • @nayandhabarde8346
    @nayandhabarde8346 Před 2 lety

    Anyone else facing this? Task 'pixel2api30BenchmarkAndroidTest' not found in project ':benchmark'.

    • @zealscar
      @zealscar Před 2 lety

      Yup, getting this same error. Which version of AGP is needed? I am using 7.2.2.

    • @anshshetty3412
      @anshshetty3412 Před 2 lety

      @@zealscar Same here. U found any solution for this ?

    • @zealscar
      @zealscar Před 2 lety

      @@anshshetty3412 using AGP 7.3.0 alpha7+ solves the task issue for time being.

    • @mlykotom
      @mlykotom Před rokem

      The task is created with Gradle Managed Devices feature that comes with Android Gradle Plugin 7.3.0 and later, so please try updating it.

    • @YashNagayach
      @YashNagayach Před rokem

      @@zealscar I implemented baseline profile in my app(Using latest versions), it is showing some improvement when we run benchmark, but no improvement I can see on play console numbers for cold startup time. Any idea?

  • @jg-jsbg4725
    @jg-jsbg4725 Před 2 lety +1

    IMPROVING PERFORMANCE WITH BASELINE PROFILES - MAD SKILLS

  • @ShadyAlAngham
    @ShadyAlAngham Před 2 lety

    😎😎🖒

  • @anmolsinghsahi7991
    @anmolsinghsahi7991 Před rokem +1

    I'm using systemImageSource = "aosp", still getting this error: java.lang.IllegalArgumentException: Baseline Profile Collection requires a rooted device, and a rooted adb session. Use `adb root`. Anyone else got this error?

    • @mlykotom
      @mlykotom Před rokem

      The aosp image should come with the rooted adb session already. Please make sure you use latest version of the Macrobenchmark library, because there was a fix to allow rooted sessions without calling adb root. Otherwise, not sure what could go wrong here without more information.
      If upgrading the version doesn't help, could you create a bug and provide more details so we can investigate it? issuetracker.google.com/issues?q=status:open%20componentid:1071684
      Thank you!

    • @vincedelricco3992
      @vincedelricco3992 Před rokem

      @@mlykotom Thanks for the tip, I was running into this issue and upgrading the version fixed it for me. I went from 1.1.0-beta05 to 1.2.0-alpha05 👍

    • @YashNagayach
      @YashNagayach Před rokem

      ​@@mlykotom I implemented baseline profile in my app(Using latest versions), it is showing some improvement when we run benchmark, but no improvement I can see on play console numbers for cold startup time. Any idea?