Is anyone make base profile with wear os? My app ...
# compose-wear
b
Is anyone make base profile with wear os? My app is currently developed with only compose. Scrolling is slow right after running the app, and the speed improves after a certain period of time. If I run the app again after killing the process on the watch, it is slow for a while, and the scroll speed improves after a certain period of time. Can this case also be considered a JIT issue like the thread below? https://kotlinlang.slack.com/archives/C02GBABJUAF/p1655128462622249 I also read about under thread. but my app is already speed-profile. [status=speed-profile] [reason=install] https://kotlinlang.slack.com/archives/C02GBABJUAF/p1665931379289959 I'm trying to proactively add a base profiler into my app. I finished all the settings with base profile code-lab, but I found that "gradle managed device" is not available on the watch. It seems that I have no choice but to root my test device or use an emulator, is there any problem with the improvement effect of the base profiler even if I make base profiler with watch emulator? Also make baseProfile on watch emulator is extreamly slow. I waiting 7 hours but it still PROGRESSING. Currently I give up about processing and retry make baseprofile on next morning. @yschimke How did you create baseline-prof.txt on under commit? Please advise me. https://github.com/android/wear-os-samples/pull/572/files
👀 3
y
Ran with something like "./gradlew benchmark:connectedAndroidCheck -Pandroid.testInstrumentationRunnerArguments.class=com.example.android.wearable.composeadvanced.benchmark.BaselineProfile"
It outputs some instructions when it completes
But the second part is measuring the impact of baseline profiles, via macrobenchmark startup/scrolling tests.
For this it's critical to run on device.
We have that sample in ComposeAdvanced.
b
@yschimke Thanks for reply. I try with your gradlew command and it trigger daemon. But still need rooted devices.
./gradlew [benchmarkmodule]:connectedAndroidTest -P android.testInstrumentationRunnerArguments.class=[baseline profile test class path]
To make a base profile, I have to choose one of the three below. And would you suggest using a rooted device? 1. rooted device 2. android emulator - not recommend. Because it is recommended that the performance measurement be performed on an actual device, 3. gradle managed device - not support wear os Is there any way to do baseprofile making without rooting on the watch like a gladle managed device?
y
I'm not sure. Ask on #performance
b
ok I ask that question on performance channel. Thank you.
b
a rooted device is needed for this? 🤔
b
Not using rooted device, then we need to use wear os emulator. However, when i try making baseline profile with watch emulator, It was extreemly slow. It looks like we need to wait until "gradle managed device" supports watch or rooting physical device. Currently, I am looking for a way to root the watch, but my test device is a Galaxy Watch 4, so I don't know if rooting is possible yet. If we don't rooting, we should create a base profile in an emulator and testing it on a real device. I'm not sure if it's normal to be extremely slow to create a base profile in the emulator.
b
all right, it does say on the doc that root is needed - I didn't know 🙂
b
yeah. maybe I will need to buy old device for making rooted device.
y
I'm running on retail GW4/5 and PW
b
maybe the doc is incorrect (or "you'll need root access for the Baseline Profile generator" doesn't mean what we think it means)
b
Oh... then I just find way to root on my GW4. Ok I got it. I watch on youtube, and he say Baseline profile is generated on system folder. For accessing the system folder, we need root authority.

https://www.youtube.com/watch?v=WWdDzXgrkmgâ–¾

y
Have you tested to ship your app release including base profile into playstore internal testing? It might not be ideal for prototyping, but you can test your release bundles in this way very fast.
b
@Yingding Wang No, I'm not created baseline profile yet. I am considering adding a baseline profile for the start speed. My app is currently release to Playstore, however there is a performance problem after moving to the "scaling lazy column" screen immediately after our app starts.
s
From my testing, I got the same baseline profile generated when using an emulator as with a device (though I agree with Yuri that for timings, you definitely want to test with a device, of course). For a baseline profile test, it should be enough to visit each screen and maybe perform a gesture on it so that each component is loaded and any important methods called - so I'm very surprised that it's taking more than a few minutes to run on an emulator.
b
@stevebower Only few minute on emulator? I can not imagine that. In my case, It never finished during 7 hours with very simple actions like wait for menu and fling down that menu. Could you share the way you tested with the wear emulator?
y
Just watched the performance improvement tipps from todays Android Dev Summit. Maybe the Immutable tag on data class can help to improve your app (https://developer.android.com/reference/kotlin/androidx/compose/runtime/Immutable)
The full video link is

https://www.youtube.com/watch?v=ahXLwg2JYpcâ–¾

b
After watching the video, I will test it by adding a tag as you suggested. Thanks you for your help. Oh my, this video uploaded on today? this is really need to me.
s
Regarding running the baseline profile test to generate a profile - I just re-ran it for androidx.wear.compose.integration.macrobenchmark and it took 57 seconds (2 minutes if you include the build time). This was within Android Studio Electric Eel Canary 8 on a Wear OS Large Round API 30 emulator. First, ran androidx.wear.compose.integration.macrobenchmark.target on the emulator. Then, ran the BaselineProfile test within Android Studio from here: https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:wear/com[…]ar/compose/integration/macrobenchmark/BaselineProfile.kt;l=54
message has been deleted
b
@stevebower Ok.. pre-run with target app is working. I can't believe this is real. Benchmark tests with MacrobenchmarkRule did not require pre-run. Why didn't I try to install the target app first before trying making baseline profile? You are a life saver. Thank you very much. I know it's good to do it on a real device, but as long as there is a limit to routing, I'm going to make it in an emulator and test it. If this helps performance clearly, I will try to create an automation function that works with the release build. @bod After building the target app in the emulator first, the baseline profile build time is perfectly normal in the emulator.