My compose app renders around 100 composables on t...
# compose-desktop
x
My compose app renders around 100 composables on the screen at the same time. I notice that it is very slow/laggy when it starts. Any action takes around 0.5-1 seconds to complete, but if I leave it alone for about 1-2 minutes, it somehow "stabilizes" and becomes very smooth. Is there anything I can do to fix this? I am testing on a low spec PC - CPU i5-4th gen, 8GB of RAM
r
I'd hazard a guess that this is due to the JVM's JIT having time to work. I don't know if Graal works with Compose, but that's generally the next step I'd take here
👆 1
x
@rnett Thanks, I'll try that 😁
d
i5 with 8GB is low spec? I'm old...
x
@darkmoon_uk the machine is 10 years old
d
...yeah... I'm gonna refer you to my previous comment 😄
m
It'd be odd if it was JIT related. It could be but other GUI toolkits don't have that issue.
With "only" 8GB of RAM it's more likely to be swapping
1
If you quit the app and immediately restart it, do you still see the lag?
x
@mikehearn I think this problem is caused by the PC itself, not compose. I just re-tested it, and everything is ok. One thing I notice is that the pc was quite hot yesterday, and I was running 3 instances of Idea, and many chrome tabs at the same time.
m
3 instances of IDEA would make a machine with much more RAM struggle. For sure you were under severe memory pressure and the delays were as the OS swapped the other stuff out.
x
@mikehearn Yes, thank you Mike :D
👍 1