Skip to content

Don't publish redundant on_scroll offsets#1788

Merged
hecrj merged 2 commits intoiced-rs:masterfrom
tarkah:optimization/scrollable-publish
Apr 12, 2023
Merged

Don't publish redundant on_scroll offsets#1788
hecrj merged 2 commits intoiced-rs:masterfrom
tarkah:optimization/scrollable-publish

Conversation

@tarkah
Copy link
Member

@tarkah tarkah commented Apr 12, 2023

This helps improve scrollable performance by suppressing redundant messages from getting published when the RelativeOffset hasn't changed.

I noticed the scrolling is very sluggish on debug mode, even with few elements. When quickly scrolling, dozens of redundant messages were coming across update causing unnecessary state changes / re-renders.

This improves the snappiness of scrollables in debug mode a lot.

@hecrj hecrj added this to the 0.9.0 milestone Apr 12, 2023
@hecrj hecrj added improvement An internal improvement performance widget labels Apr 12, 2023
@tarkah tarkah force-pushed the optimization/scrollable-publish branch from 5c2cadc to 4125c03 Compare April 12, 2023 21:08
@tarkah tarkah requested a review from hecrj April 12, 2023 21:09
Copy link
Member

@hecrj hecrj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome! Thanks 🎉

@hecrj hecrj merged commit 3dc76ca into iced-rs:master Apr 12, 2023
@tarkah tarkah deleted the optimization/scrollable-publish branch April 12, 2023 22:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments