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

Lots of idle time when loading 6.5k items #733

Open dplatt-xavier opened 2 years ago

dplatt-xavier commented 2 years ago

It's currently taking me 5+ minutes to load a list of around 6.5k items.

<RecycleScroller
    class="scroller"
    :item-size="80"
    :items="myItems" // 6.5k objects
    key-field="id"
    v-slot="{ item }"
    :prerender="5"
>
    {{ item.name }}
</RecycleScroller>

The network request to retrieve the data is currently taking 8s in my local environment (obviously some performance issues here to get to for myself) but that doesn't really explain where the rest of the 5 minutes is coming from. I have observed the performance tab and recorded that there is a lot of "idle" time and a lot of time taken up by "GC events".

I can see that this can support up to 500k items, but with 5 minutes of loading for 6.5k items, I don't think that would be possible.

In this time, the screen is essentially frozen from about 15s or so, until the paint on the screen.

Is there anything that could be causing such a slow load please?

Akryum commented 2 years ago

Looks like the virtual scroller is trying to render everything at once. Try setting a fixed height in pixels to it to troubleshoot.

dplatt-xavier commented 2 years ago

Is :item-size="80" setting the height to a fixed size?

Akryum commented 2 years ago

It sets the height of the items, but if the scroller doesn't have height, it will try to render everything since it's not scrolling.