I just started using Jetpack Compose with AS Giraf...
# android-studio
k
I just started using Jetpack Compose with AS Giraffe. Why is preview so slow? Usually the Loading text goes on until I do a rebuild
c
Hmm it should be definitely faster than previous versions. What version of Compose are you using?
k
BOM version 2023.03.00
c
And version of your compiler? Also what machine are you on? And has this just started happening?
k
Compiler is 1.3.2 and Giraffe 2022.3.1 Canary 11. Well, I just started Compose work last week. I'm on an M1 16" MacBook. Pretty beefy with 64G memory. Could be VPN? I just restarted machine
c
ooh. Im also stuck on an old compiler version because i can't bump kotlin version past 1.7x i wonder if this is the culprit of deathly slow previews.
c
Hmm I’m on all the same versions and machine, so wonder if there’s something in the code itself, like the dependency complexity. With Fast Preview, it builds as minimal as possible, but it does still try to build transitive dependencies where needed, i.e. dependent Composables from user code.
Let me check with the team to see if we have any benchmarks across Compose versions (including compiler)
Could y’all also quantify what “slow” is? And are you seeing it just as slow on say really small projects comparatively?
On the compiler version, there is an internal one used for Fast Preview, so it shouldn’t have an impact necessarily
k
So, the UI itself is pretty simple. Loading just spins until I do a rebuild. It's pretty much just easier to just rebuild and run the app. Preview is almost worthless
c
Yeah, I'm doing simple stuff here. project is also simple. 2 modules.
1 being the app. the other being a completely decoupled design system. thats where i use the preview annotations. and its still hella slow
c
Would it be possible for either of you to file a bug and attach your logs? This is unexpected from the team, so they would need to see the logs to really investigate properly.
k
Do you have instructions on this? I seem to recall that filing bugs is usually a painful process
n
hey Kevin, you can create a bug here https://issuetracker.google.com/issues/new?component=192708&template=840533. In this case, you can ignore the bug description. We just need you attach the output of
Help/Collect Logs and Diagnostics...
if you have a small sample that reproduces the problem for you, feel free to add it as a comment too.
k
Filed
c
cool. i'll do this as well. im in and out of the office this week. but im sure the next time it happens i will try to create a bug with those outputs
k
Hmm. My bug just got rejected as "Infeasible". Not enough info to proceed
c
Can you send a link to it?
c
Thank you! I forwarded to the team. Our triage process isn’t the best when bugs are filed to the main public component
k
FYI: I’m now testing on my personal Mac and preview is a lot faster. Could be VPN or other issues with corporate laptop?
c
@kevindmoore nice job filing that issue. Looks like it'll be fixed in canary 5!!! Woot woot. thanks @Chris Sinco [G]
k
Yes!!
Glad they listened
c
Yep! It's so nice not to have your anecdotal experience brushed off. I've seen much better preview speed in Canary 3. Looking forward to c5!
178 Views