Skip to content

feat: allow throttling update calls #764

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 1 commit into from
Dec 14, 2022
Merged

feat: allow throttling update calls #764

merged 1 commit into from
Dec 14, 2022

Conversation

pulsejet
Copy link
Contributor

updateVisibleItems needs to get the value of scrollTop, which can be expensive because of layout calculations. Further, checking the view at 60fps can be overkill, especially if you have a well-sized buffer. Setting updateInterval to a small value such as 100ms drastically reduces CPU usage.

Signed-off-by: Varun Patil varunpatil@ucla.edu

Chrome CPU profile comparison under identical conditions (and no visible change to user experience).

image

@netlify
Copy link

netlify bot commented Oct 29, 2022

Deploy Preview for vue-virtual-scroller-demo ready!

Name Link
🔨 Latest commit 0d201a9
🔍 Latest deploy log https://app.netlify.com/sites/vue-virtual-scroller-demo/deploys/635da9e8635bc500080d7d28
😎 Deploy Preview https://deploy-preview-764--vue-virtual-scroller-demo.netlify.app/
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@pulsejet pulsejet changed the title Allow throttling update calls feat: allow throttling update calls Oct 29, 2022
updateVisibleItems needs to get the value of scrollTop,
which can be expensive because of layout calculations. Further,
checking the view at 60fps can be overkill, especially if you
have a well-sized buffer. Setting updateInterval to a small
value such as 100ms drastically reduces CPU usage.

Signed-off-by: Varun Patil <varunpatil@ucla.edu>
@Akryum Akryum merged commit 9ba57d7 into Akryum:master Dec 14, 2022
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants