Skip to content
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

Don't publish redundant on_scroll offsets #1788

Merged
merged 2 commits into from
Apr 12, 2023

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
native/src/widget/scrollable.rs Outdated Show resolved Hide resolved
@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