https://kotlinlang.org logo
s

spierce7

02/15/2021, 1:45 AM
I created an app in compose for AndroidTV. I’m now ditching compose and moving back to the Android View’s to hopefully get better performance. Android TV’s are basically just super low-end Android devices. I’ve tried to identify anything I’m doing wrong, and even tried to isolate changes into individual widgets, but I still see long pauses, and chugging in animations. I’m curious if it’s known how Compose performs in relation to standard Android View’s. It seems slower to me. It’s still in alpha though, so I’m curious if performance optimizations have started to happen.
r

romainguy

02/15/2021, 1:47 AM
Could you please share the actual device(s) where you saw this as well as performance profiles if you can? @Adam Powell @Chuck Jazdzewski [G]
s

spierce7

02/15/2021, 2:45 AM
Here is the actual device - Chromecast with Google TV. https://store.google.com/us/product/chromecast_google_tv @romainguy What would be the best way to get a performance profile? Are you talking about one extracted from Android Studio, or is there something else you had in mind?
r

romainguy

02/15/2021, 2:48 AM
Yes the one you capture with Android Studio
Is there a chance you could share an apk and/or source code so we can reproduce and figure out where the issue is from?
1
a

Adam Powell

02/15/2021, 3:13 AM
we've been developing compose on some quite low-end devices, we're definitely interested in specific test cases like this for performance investigation if you can share them!
c

Cyril Find

02/15/2021, 10:14 AM
I'm also experiencing slow UI on some devices using
Exoplayer
inside
AndroidView
in a
LazyColumn
(especially when scrolling), I guess that's what @spierce7 uses if targeting Android TV ?
1
For example on a OnePlus 3T (so not that shitty but I've had it for a few years):
I dont know if that's the kind of report that's useful for you ?
r

romainguy

02/15/2021, 6:34 PM
Are those traces from the method profiler or system traces? System traces are more useful as a first step
c

Cyril Find

02/16/2021, 8:58 AM
oh these are methods I'll do a sys trace then (i'm not really used to all these sorry 😅 )
r

romainguy

02/16/2021, 5:07 PM
Thank you
😁 2
v

VM

05/25/2021, 11:08 AM
Been following this thread - just wanted to check if there is now an improvement in the performance issues on TV apps with the recent betas.. We have been building on compose android mobile and now wanted to take up TV for low powered and AOSP devices.. Thank you!! @Cyril Find @spierce7
c

Cyril Find

05/25/2021, 1:44 PM
hey, i didn't hear back from romain about this but that was a sidetrack from the TV subject anyways so I don't really know what's up 🤷
s

spierce7

05/25/2021, 2:16 PM
I ended up rebuilding the app in standard android views, getting much better performance. Some of the traces I showed Romain indicated very slow bitmap scaling operations. I never really dug into potential fixes.
Android TVs / Fire TVs tend to have very low end processors.
v

VM

05/25/2021, 2:20 PM
Agreed - dumb question maybe but is Compose not aiming to optimise for low powered phone/TV devices at 1.0? Am sure rebuilding for tv apps with standard view is duplication
s

spierce7

05/25/2021, 3:25 PM
I think it’s likely there were things I could have done to fix it. I just didn’t know what they were.
Compose support for navigating around the screen with a controller was also broken at the time. Compose had a bug where it would literally eat all the button navigation events from the activity. I had to create a hacky work around.
t

Thomas

05/25/2021, 3:29 PM
Google is working on compose for Wear OS so I assume there will be some performance improvements which should impact TVs as well.
v

VM

05/25/2021, 3:29 PM
Ya I believe they have provided for DPad and navigation support. As for performance I guess only way is to build a small app as I could not find any sample tv apps under heavy dev
a

Adam Powell

05/25/2021, 3:29 PM
A lot changed in terms of performance in the past 3 months, for the better 🙂
🎉 2
s

spierce7

05/25/2021, 4:53 PM
I’d really like to move back to compose. Especially if Native ever supports compose.
g

Gagan Deep

09/16/2021, 9:38 AM
Hey Guys, I am also planning to use Compose in Android TV, so wanted to learn from your findings. Do you have any resources on how to use d-pad with compose, I am having issues with LazyRows and D-pad navigation
s

spierce7

09/16/2021, 5:03 PM
@Gagan Deep Have you ever made an Android TV application before?
g

Gagan Deep

09/17/2021, 4:32 AM
@spierce7 No, this is first time i am starting with TV application.
s

spierce7

09/17/2021, 2:21 PM
So the thing that might come as a surprise - a $30 firetv lite isn’t going to perform the same as a phone
Walmart came out with a $30 android tv though, and it’s pretty fantastic
But the cheap devices will lag, even with standard android views and will lag even more with compose.
g

Gagan Deep

09/18/2021, 10:11 AM
ohkk.. thanks for the information
s

spierce7

09/19/2021, 3:57 AM
That being said - once Compose for iOS comes out, my plan is to move back to compose, and just… not have animations. At least on some Low End devices
g

Gagan Deep

09/20/2021, 5:15 AM
ok.. but how did you implement LazyScroll and Dpad navigation, i see there are open issues https://issuetracker.google.com/issues/199061125 https://issuetracker.google.com/issues/191276596 and to have a D-pad navigation we need to handle scroll state on our side only, its not provided by default. Do you have some resources how did you handle that!
s

spierce7

09/20/2021, 12:22 PM
So when I looked into it, the focus feature wasn’t completely finished. Also there was an actual bug that introducing a compose view to the activity, basically killed all key press events in the activity.
I’m surprised that they still have open problems with this in your posted tickets
g

Gagan Deep

09/20/2021, 12:26 PM
yeah, thats the main concern
5 Views