Does anyone know the performance of my app would b...
# compose-wear
j
Does anyone know the performance of my app would be slow on a live device (Google Pixel Watch Gen.1)? The app performs fine on an emulator. If I build the app in release mode the performance is better but still appears to be slower than running on an emulator. I’m not performing an network or IO operations. I’m using androidx-compose-bom: `2023.10.01`and horologist:
0.5.9
m
did u connect the device (paired) in android studio? there, it may be the profiling tool for checking the app performance
j
I’ve disconnected the watch by disabling wireless debugging and the performance is still terrible.
a
This happens to me too sometimes with GalaxyWatch 4 / Watch6. Adb disconnect is not helpful. Adb reboot usually helps.
j
What's the command to perform an adb reboot?
y
Emulators are way faster than devices.
I don't usually bother with debug builds on devices. And on device setting up your release build properly with baselines profiles also makes a huge difference
j
I would like to be able to debug my app. Also when using a release build on a live device the string resources return incorrect values.
y
You can debug, just expect performance to be terrible.
The resources thing sounds like a different problem you should work through
j
The resources work fine on an emulator with release builds.
y
Yep, but I haven't seen this before in my apps. So there must be some other factor
j
Do you have a suggestion of what I could look into in order to fix this issue? It doesn't occur for all string resources
y
No, but I guess I'd enumerate the resources, print out any thing relevant to the selected qualifiers.
If still happening, extract a repro and file a bug
j
I wanna circle back to your previous response about setting up baseline profiles. Do you have documentation on how to do such?
y
Probably not completely up to date, as it predates the baseline profiles plugin. But that's key point. It's the same as mobile
These do age a bit because they tend to be a bit manual outside of a paid prod app. So consider starting with the baseline plugin and asking questions
j
I plan to try Baseline profiles in the morning. Do they only work with release build? If so, how can I debug with a release build. Are there any trade odds to doing so?
y
Generally yes the resulting profile goes into release build. I wouldn't try debugging the profile. But macro benchmark let's you test the impact of profiles.
j
Follow up. I haven’t implemented baseline profiles just yet but I’m looking into profiling my app and I notice my memory usage is fairly high. Is using .copy(…) on UiState Data classes particularly harmful on Wear OS compared to mobile?
Should I perform to update existing instances instead of creating new one or is the GC very efficient for Wear OS.
y
I'm not going to speculate. You should measure before changing the code to optimise. But I haven't seen it myself. And mutable objects cause way more complexity in UI code than copies.
m
@yschimke wait.. how can i integrate a base profile for wearos app? in android studio project creation tool, how to configure it properly (micro vs macro)
y
I linked to examples above