vuejs / Discussion

Vue.js discussion
167 stars 17 forks source link

Thousands of rows performance #1325

Open fergardi opened 6 years ago

fergardi commented 6 years ago

Hello! I love Vue and use it in almost all my profesional and personal projects!

But now, I have a little problem. In my project, I have like 5k rows of data that need to updated in real time using live stock information by websocket. I usually use vue and vuex reactivity to handle this sort of stuff. I listen to channels and handle a message by callbacks which find an element in my array and update several of the fields in the object with the new information. It works fine with <100 rows, but after that, the performance decreases to a unusable state.

I've found several obstacles so far:

I wanted to ask for advices in how would be the best approach in solving this problem.

What I've tried so far:

What i've not tried so far:

I find this issue really interesting, and I'll be glad to read all the suggestions anyone can offer.

Thank you in advance.

csigmanek commented 6 years ago

My advice: avoid putting everything in the store. Only put the things you actually need in the store and load the rest from a window object. E. g. window.data. Too much data really slows vue.js down. I tried a Clusterlibrary and its performance was extremely bad as long as i passed the data through props. When i worked with an event + storage in the window object, it worked just fine. Same goes for too much data in the store. Now i only put the data that is visible in the store and update it if necessary from the window object. It really improved the performance.