Hi everyone, I'm working on a big desktop project ...
# compose-desktop
m
Hi everyone, I'm working on a big desktop project using compose, and it's a pdf editor where you can see the content of a pdf file and draw stuffs on it, I'm using compose canvas but when the user is drawing the project uses a big percentage of the CPU and the app is laggy in some devices, any ideas ? (idk if I could use skia I thought that it's used by default, also for hardware acceleration is it enabled by default ?)
a
A sample we could run would help.
l
I’d guess that the pdf content is on the same layer as the drawings above, or is missing a remember. It’s probably drawing too much at once, when most of it should be cached.
k
How is the performance when you don’t display the PDF content, and only show the canvas with the user drawing?
m
@Landry Norris true, is there something similar to android layout inspector to debug recomposition.
@Kirill Grouchnikov I tried to remove the pdf and also remove the drawings so I'm just listening to the gesture and updating the state and the performance is the same, I have a single big state for the hole project and I'm using MVIKotlin, so when I draw each drag movement is going to update the state again
@Alexander Maryanovsky I will create a sample ASAP
a
Thanks
k
Remove as much as you can so that it's easier to reproduce and debug. Sounds like you need to take a look at how you're tracking the user interaction, even before the drawing itself