-
Notifications
You must be signed in to change notification settings - Fork 81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix FPS drops when dragging scrollable content #1503
Conversation
I think @igordmn also needs to have a look. |
compose/ui/ui/src/uikitMain/kotlin/androidx/compose/ui/window/MetalRedrawer.uikit.kt
Outdated
Show resolved
Hide resolved
compose/ui/ui/src/uikitMain/kotlin/androidx/compose/ui/window/MetalRedrawer.uikit.kt
Outdated
Show resolved
Hide resolved
compose/ui/ui/src/skikoMain/kotlin/androidx/compose/ui/scene/BaseComposeScene.skiko.kt
Outdated
Show resolved
Hide resolved
@@ -205,6 +206,7 @@ internal abstract class BaseComposeScene( | |||
nativeEvent = nativeEvent, | |||
button = button | |||
) | |||
recomposer.performScheduledEffects() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have a failed test catch only the first scroll event in one frame
.
We can remove it, as this behaviour is no longer needed and it is written based on maybe incorrect interpretation of pointerInput
+ awaitPointerEventScope
.
A context why it was written:
In Jetpack Compose 1.0 we had very slow handling of a scroll event. Native systems on the other hand can send 20 events per frame, and it is much slower to handle 20 events instead of one. So we decided to handle only the first one, relying on coroutine dispatching inside pointerEvent
.
Now we don't have such issues, I checked a heavy Lazy List, there are no difference in FPS/lag comparing to jb-main
. If we decide in the future that we need some event filtering/batching, we should do it differently, not relying on pointerInput
dispatching.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed it, it needs to be merged for 1.7.0-beta01
Apply all scheduled effects after each interaction event so that they are applied synchronously.
Fixes: https://youtrack.jetbrains.com/issue/CMP-1644
Fixes: https://youtrack.jetbrains.com/issue/CMP-4438
Release Notes
Fixes - iOS
Fix frame drops when dragging scrollable content on iOS