s

    Susheel

    1 year ago
    I heard that having R8 disabled will have a significant impact on Compose Render time. I was just reading this article about it. I was just wondering if Google recommends to enable R8 for compose?
    Adam Powell

    Adam Powell

    1 year ago
    Yes, we recommend enabling r8
    Kirill Rozov

    Kirill Rozov

    1 year ago
    Does R8 have specific optimizations for Compose?
    Adam Powell

    Adam Powell

    1 year ago
    no, but many of its general-purpose optimizations are very helpful for compose
    lambda-heavy code in particular tends to benefit quite a bit
    not to mention it will omit a lot of unused code; any parts of the compose libraries themselves that you aren't using, any
    @Preview
    functions and associated utilities that you may have in your existing source files...
    Stylianos Gakis

    Stylianos Gakis

    1 year ago
    Is stripping @Preview composables a specific optimization or just due to the fact that they're not called explicitly? What if we do call them from somewhere, they're not stripped then right? What if a library uses them, like showkase uses them from the generated code 🤔
    Adam Powell

    Adam Powell

    1 year ago
    the result of not being called explicitly. If you generate code that calls them, that will still work.