3 ms·
Why doesn't that scale? What would the optimizations be?
by edflsafoiewq 4y ago
Why doesn't that scale? What would the optimizations be?
- artificialLimbs 4y agoDon't know if this is directly related but the last time I fetched 9,000 elements to a select list, my browser went HRNGHHHH (on an M1 Macbook Pro). (No, 9,000 elements in a select list was not intentional.)
- toastercat 4y agoBecause if you wanted to make changes to the table, and your rendering mechanism is rewriting to innerHTML, it's going to nuke all the elements and create new ones (even those that don't need to be recreated). On the other hand, DOM APIs can get expensive quickly especially if you're calling `document.createElement` repeatedly to create maybe 1000s of table rows. So then you have to find ways to minimize the amount of DOM operations that must happen. Or like the rest of us, just pick up a JS library that already solved this problem.