Akryum / vue-virtual-scroller

⚡️ Blazing fast scrolling for any amount of data
https://vue-virtual-scroller-demo.netlify.app
9.36k stars 896 forks source link

feat: allow throttling update calls #764

Closed pulsejet closed 1 year ago

pulsejet commented 1 year ago

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[bot] commented 1 year ago

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

Name Link
Latest commit 0d201a9ac605cc366f41af99f0205fe51c1d0327
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.