https://kotlinlang.org logo
#compose-wear
Title
# compose-wear
j

Jonathan

11/02/2023, 8:35 PM
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

marlonlom

11/02/2023, 8:52 PM
did u connect the device (paired) in android studio? there, it may be the profiling tool for checking the app performance
j

Jonathan

11/02/2023, 8:54 PM
I’ve disconnected the watch by disabling wireless debugging and the performance is still terrible.
a

amoledwatchfaces

11/02/2023, 10:17 PM
This happens to me too sometimes with GalaxyWatch 4 / Watch6. Adb disconnect is not helpful. Adb reboot usually helps.
j

Jonathan

11/02/2023, 10:21 PM
What's the command to perform an adb reboot?
y

yschimke

11/02/2023, 10:42 PM
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

Jonathan

11/02/2023, 10:46 PM
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

yschimke

11/02/2023, 10:49 PM
You can debug, just expect performance to be terrible.
The resources thing sounds like a different problem you should work through
j

Jonathan

11/02/2023, 10:50 PM
The resources work fine on an emulator with release builds.
y

yschimke

11/02/2023, 10:51 PM
Yep, but I haven't seen this before in my apps. So there must be some other factor
j

Jonathan

11/02/2023, 10:53 PM
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

yschimke

11/02/2023, 10:54 PM
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

Jonathan

11/03/2023, 12:42 AM
I wanna circle back to your previous response about setting up baseline profiles. Do you have documentation on how to do such?
y

yschimke

11/03/2023, 12:47 AM
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

Jonathan

11/03/2023, 1:08 AM
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

yschimke

11/03/2023, 1:44 AM
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

Jonathan

11/03/2023, 7:22 PM
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

yschimke

11/04/2023, 6:46 AM
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

marlonlom

11/10/2023, 4:39 PM
@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

yschimke

11/10/2023, 11:21 PM
I linked to examples above
5 Views