I've made thit list with compose. Are these perfor...
# compose
m
I've made thit list with compose. Are these performances normal/expected? Gist: https://gist.github.com/manueldidonna/1eef3017a4ff4e42865641482ea78817
🤔 2
l
if you’re not doing anything other than scrolling then definitely not 🙂 If you have code to share it might be insightful for us to understand how you’re falling into a performance trap though
m
I am very curious to understand where the error lies
r
It’s bizarre that so much time is spent issuing GPU commands
It also looks like your list items have 2 backgrounds but I don’t understand was causes that in your code
m
The entire layout is:
Copy code
Column -> Surface -> Box -> Column -> List & Toolbar
Surface is the only one that draws a background. The first column has the main layout and a bottom navigation. Box is needed because I have a centered dialog screen that appears over the list
a
while this isn't likely to be related to the performance question, try the
Dialog
composable, it creates a real dialog that behaves correctly with Android window management rather than a css-overlay style thing in the same window 🙂
m
@Adam Powell Thanks, I will use it
l
the code actually looks quite reasonable
if i had to guess, i would say that image is acting up for some reason
if you replace image with just a box of the same size, does it get way better?
m
I've replaced the image with a box (same modifiers + a background). I've also used a proper Dialog composable but it doesn't affect the performance
l
hmmm. those spikes don’t look great for such simple items. also gpu still taking longer than i’d expect
wonder if we are drawing everything for every scroll?
r
GPU isn’t high here
m
Do you need some info? It's a debug build and I'm using a oneplus 6T
r
What’s worrisome in the spikes is the green stuff
that’s time spent in composition/measure/layout of Compose I assume
(it’s basically time unaccounted for by the View system)
The blue stuff is short but that’s bitmap uploads I think? as if something was being invalidated on every frame
m
I've changed the adapter list with VerticalScroller + Column. There are 20 items. Performance seems to have improved 🙃
l
sorry i thought red was gpu. the green stuff is indeed worrisome. not sure if this time is adapterlist specific or more compose runtime + subcomposition. but it definitely shouldn’t be that expensive