JetBrains / compose-multiplatform

Compose Multiplatform, a modern UI framework for Kotlin that makes building performant and beautiful user interfaces easy and enjoyable.
https://jetbrains.com/lp/compose-multiplatform
Apache License 2.0
15.9k stars 1.16k forks source link

"Visual effects" example app has performance issues #3654

Open azarovalex opened 1 year ago

azarovalex commented 1 year ago

Describe the problem I was testing public examples in this repo and noticed that visual effects example has noticeable performance issues, at least on iOS. A Release build without a debugger connected shows around 20-30fps on iPhone 11 Pro.

As we can see from the Metal debug HUD each frames takes around ~47ms to render and less than 2ms of that time is spent on GPU, so CPU seems to be a bottle neck in this case.

It's possible that the reason for bad performance is in the sample app itself (in which case it probably shouldn't be a public sample?) or it can be a performance issue in Compose Multiplatform + Skia.

Affected platforms At least iOS, I didn't measure performance on Android.

Versions

Sample code Example app lives in this repo.

Reproduction steps Build example on iOS device, enable Metal HUD and observe performance on "Wave Effect" or "Happy New Year" screens.

okushnikov commented 2 weeks ago

Please check the following ticket on YouTrack for follow-ups to this issue. GitHub issues will be closed in the coming weeks.