jsgrid icon indicating copy to clipboard operation
jsgrid copied to clipboard

updating performance question?

Open kylebakerio opened this issue 5 years ago • 1 comments

  1. Help Request/Question: A) Clearly state your problem speed of ("updateItem") vs. ("option", "data") B) Include your code $(#${card.gridId}).jsGrid("option", "data", data); C) If Applicable, attach a JSFiddle or CodePen N/A (you can see covid.kylebaker.io for running example if desired, but isn't necessary)

I am running jsgrid, and when trying to rapidly update the grid by using the 'option' method and injecting new rows, it is the slowest part of my page update. Previously I was re-initializing the grid from scratch; what happens now doesn't seem much faster.

My question is, is there a significant speed difference available to me if I manually attempt to figure out if the present item is already in the grid (every row, present and now present, does have a unique 'rank' value), and only use "updateItem" and "deleteItem" when needed?

Or maybe there's a better way, like perhaps injecting all possible rows into the grid at initialization and then hiding/revealing rows as needed by using updateItem somehow (is this supported/how would I do that most naturally in this library)?

In short:

What is the most performant way to update the grid's visible content?

kylebakerio avatar May 07 '20 14:05 kylebakerio

Just want to say that given how slow this is, you guys would probably see an incredible performance boost from switching to a virtual dom implementation--you could include the entire mithril library, barely increase your code size, probably reduce your overall code complexity, and see huge performance gains.

I'm invested at this point on this project, but it's significant enough of a drag (the literal bottleneck in my app is waiting for this grid to load its new data, and it's not that much data...) that I'll probably look for an alternative next time around.

Otherwise, love it.

Again, if there's a faster way, I'd be glad to know.

kylebakerio avatar May 08 '20 10:05 kylebakerio