Improving Performance with Baseline Profiles - MAD Skills
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
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.
Thanks! Can You provide more episodes of MAD Skills?
Hi Tomas! You can check out the MAD Skills playlist here: goo.gle/MAD-Playlist
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.
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.
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...
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?
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 💻
information very good
Thanks for the love, Hong. You can check out even more MAD Skills episodes with the playlist here: goo.gle/madskills 😁
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?
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.
@@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 :)
How many user credentials keep things the same?
Thanks for many interesting knowledge
We're happy to hear you enjoyed the video 😀
Be sure to check out more episodes of MAD Skills right here:
goo.gle/madskills
nice practice lesson
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
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
How many developers make the same assumption?
getting this error:
* What went wrong:
Task 'pixel2Api31BenchmarkAndroidTest' not found in project ':benchmark'.
This feature is available in Android Gradle PLugin 7.3.0 and higher, so pls update.
Any solution to this? I have AGP 8.0
Is it possible to do on Flutter?
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.
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?
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).
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.
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?
is it outdated?
Anyone else facing this? Task 'pixel2api30BenchmarkAndroidTest' not found in project ':benchmark'.
Yup, getting this same error. Which version of AGP is needed? I am using 7.2.2.
@@zealscar Same here. U found any solution for this ?
@@anshshetty3412 using AGP 7.3.0 alpha7+ solves the task issue for time being.
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.
@@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?
IMPROVING PERFORMANCE WITH BASELINE PROFILES - MAD SKILLS
😎😎🖒
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?
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!
@@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 👍
@@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?