Is it normal for the Compose preview to take aroun...
# compose
z
Is it normal for the Compose preview to take around a minute or more to render? Is that normal? The associated gradle build completes in 6 seconds
l
How complex is the preview? Are you passing in any ViewModel or other code that’s running, or is it just a dumb view?
May also want to check for LaunchedEffects or similar.
z
it’s a dumb view
relatively simple, just stepping into
@Compose
l
What Android Studio version and AGP version in root level build.gradle?
z
giraffe 4/ agp
7.4.1
l
Have you tried latest stable Eel?
z
not yet. would you say that taking a minute + is abnormal, given the gradle build is so fast?
l
I’d imagine. My previews are pretty quick, but it could also be device. I’m on a specced out macbook pro with M1.
z
same
l
I’d possibly try out Eel and file a bug report if it’s slow too.
To clarify: is this just when booting up, or every time you refresh the render? Is Live preview on?
z
I have live preview off bc I was noticing poor performance in the IDE for typing when I had it on I assume this is the control for live updates
l
Yes. I’d expect it to take a while to render the first time, but not after that.
e
Rendering happens very quickly for me in Flamingo
a
same issue in giraffe, on large project with many modules (200+) for private previews in smaller independent modules. takes over a minute, longer than the actual app compile from cache with configuration cache.
compose 1.3.3, compiler 1.4.0, etc
z
@agrosner does it only happen for you in Giraffe?
have you tried it in flamingo or electric eel?
a
its been happening for every version in past 6+ months, i figure it may not be fully optimized for large projects
it doesnt seem to use same build mechanisms like gradle to render (at least visibly) so its not clear how it caches information and how we can speed it up
e
My project has 150+ modules, but only a handful of them have previews.
a
same. not many.
live edit is much faster and more efficient on a demo page than previewing
(when it works)
m
I noticed a big speed improvement for Preview with Patch 1 of AS Eel