vue-virtual-scroll-list icon indicating copy to clipboard operation
vue-virtual-scroll-list copied to clipboard

Severe lag spikes while scrolling

Open bluskript opened this issue 4 years ago • 12 comments

When trying to use vue-virtual-scroll-list in a project of mine, I noticed that the app started experiencing some really heavy lag whenever I scrolled far enough. If I use the Vue debugger, I see that there is a massive amount of events being dispatched at those times, which leads me to suspect that I'm probably missing something important. Here is a video demonstrating the issue:

https://user-images.githubusercontent.com/52386117/103446311-30824000-4c4c-11eb-8b56-b563ae1d4f0b.mp4

Also, here is a list of things I have tried and were proven unsuccessful:

  • Removing avatars and time strings
  • Setting a fixed height on the scroll container
  • Remove all local state for messages
  • Disable markdown formatting

Here is the code: https://github.com/harmony-development/tempest/blob/virtual-scroller-test/components/Chat/Messages/index.vue

bluskript avatar Jan 01 '21 21:01 bluskript

These events are both necessary inside component, is there make performance problems or stuck?

tangbc avatar Jan 05 '21 02:01 tangbc

Freezes. It's smooth until I scroll far enough, and then the UI freezes for a second as I have shown in the video.

bluskript avatar Jan 05 '21 03:01 bluskript

I meet the same question

gongxiansheng avatar Jan 05 '21 09:01 gongxiansheng

One of the problems I found before is that when Chrome Devtool is turned on, it will get stuck. When Chrome Devtool is turned off, it will be OK.

tangbc avatar Jan 05 '21 12:01 tangbc

I disabled all extensions and tested without Chrome Devtools, but there is still a lot of lag.

bluskript avatar Jan 05 '21 15:01 bluskript

I think there are too many resized and item_resized, at the time of the freeze there are 122 events. There are only 50 items in the list. This means that the resize event is being called for every single item in the list, not just new ones. image

bluskript avatar Jan 05 '21 15:01 bluskript

Having the same issue. Completely freezes and locks up even with devtools closed.

JeffJassky avatar Jan 10 '21 16:01 JeffJassky

https://user-images.githubusercontent.com/52386117/104789353-d82a6280-5762-11eb-8849-b097770799a2.mp4

It happens with plain <span>s too. Clearly an issue with the app configuration, I will do some more debugging. It might be a problem with Vuetify...

update: having Vuetify in the same app doesn't cause any lag.

update: screw it i'm rewriting my app from scratch, this time hopefully it'll have no issues...

bluskript avatar Jan 15 '21 23:01 bluskript

I found an answer! After rewriting my app with some less bloated components, I found that the virtual scroller was still laggy, at which point I decided to fiddle around with the :keeps and :estimate-size props, and after a bit of experimentation and math, I came to the following: :estimate-size="40" :keeps="36" It scrolls much smoother now, although still laggier than whatever Discord is doing.

bluskript avatar Jan 20 '21 22:01 bluskript

Same issue here. Also tried the trick that @Bluskript mentioned but it did not fix the issue. Closing devtools also not helping.

fkranenburg avatar Feb 11 '21 12:02 fkranenburg

When I try to use Vue virtual scroll list to load a lot of data in my project, I notice that as long as I scroll far enough, the application will start to encounter some very serious delays and the screen will be white. How can I add the loading effect during this white screen time?Help me,thanks!

xmggy avatar Mar 30 '21 09:03 xmggy

very freezy lags... i'll go back to v-for) . very hard lags when updating real list (keeps parameter). even if component contain only text from source

pavellzubkov avatar Sep 16 '21 18:09 pavellzubkov