https://kotlinlang.org logo
#compose
Title
# compose
k

kioba

09/16/2019, 6:15 PM
I just listened to the benchmark episode on the backstage podcast and there was a brief mention of compose and the benchmark lib. Can you tell us a little about these tests? Also about that insight you learned?
👍🏼 3
1
l

Leland Richardson [G]

09/16/2019, 10:57 PM
We are using the benchmark lib to understand where we should invest effort improving performance in a lot of different areas. It has been tremendously helpful so far, and has led to various improvements and also some design decisions we still are working on implementing right now
it informed some changes we made in layout. i’m not sure if the specific things are that interesting to talk about (and i’m not really close enough to that part to speak on it tbh)
also the compose runtime itself
we’ve made some changes to how “recompose scopes” get used since we ended up seeing a lot of waste and overhead there. it’s also helped us remove a slow-path in composition “groups” that we didn’t know we were hitting but we were
and also caused us to prioritize some optimizations around removing groups where they weren’t needed since they were causing more overhead than we initially thought they would
there’s lots more but a lot of it is stuff we are still sort of analyzing or figuring out how we should optimize
but it’s been useful to have those tests to let us know when we regress and also what our baseline is
m

mzgreen

09/17/2019, 5:31 AM
I guess we’ll eventually get those phones with 120hz displays so great to hear that Compose will be fast 👏
l

Luca Nicoletti

09/17/2019, 9:21 AM
@Leland Richardson [G] Can you tell us a little more about how you’ve been using the benchmark lib to test Compose?
1
r

romainguy

09/17/2019, 3:15 PM
You should be able to see all the benchmarks we use in the source tree.
l

Leland Richardson [G]

09/17/2019, 4:19 PM
yeah i think your best bet is to just check out the source. i’m not sure what you’re expecting but it’s not that interesting. we are just using the lib to do perf measurements across different parts of the system, depending on what we are interested in
k

kioba

09/18/2019, 2:39 PM
haha 😅
"do perf measurements across different parts of the system"
that is actually interesting for us. Especially knowing about the small details of performance investment and tricks you do. Thanks for the information btw @Leland Richardson [G] ! It is a good introduction to the topic and will check out the source. 🙂
l

Leland Richardson [G]

09/18/2019, 4:28 PM
fwiw, there’s still a lot of perf optimizations that we think we want to do that we haven’t done yet. It’s good to start measuring though so that we know how impactful these optimizations are, as well as whether or not it is worth optimizing something based on how much time it is taking currently relative to other things (ie, is it the bottleneck?). Once we get into a better place I think it could be an interesting post or something to cover a lot of the decisions we made relating to perf and what results we saw from it.
👍 1
also if you’re interested in perf and haven’t seen my talk from chain react conference, it might be pretty interesting to you.
3 Views