Are there any downsides/ performance impacts when ...
# compose
a
Are there any downsides/ performance impacts when using Generic composable function? e.g
Copy code
@Composable
fun <T> CardList(
    items: List<T>,
) {
    // TODO Draw your list here.
}
m
I have a few of them on a prod app and have not seen any particular performance issue ( related to generic that is 😅)
z
tl;dr: No, I’m pretty sure. The only way I can think this could potentially affect performance is that it might prevent compose from inferring stability in some cases that it would without generics. But I wouldn’t worry about that until you’re profiling benchmarks, and in your example code it wouldn’t happen since
List
isn’t stable anyway.