3 ms·
This blog says what I've always thought - that to keep a large web application performant, you need to eliminate all redundant calls and operations, even in to
by AshleysBrain 5y ago
This blog says what I've always thought - that to keep a large web application performant, you need to eliminate all redundant calls and operations, even in to pure JavaScript code - not just DOM calls. If your pure JS code already is designed to eliminate redundant calls, then you already get the minimal DOM calls from JavaScript too. That's the best case, and VDOM can only be slower as it adds diffing overhead on top.
There might be other good reasons to use a VDOM (including cases like using the DOM in a web worker). But I don't think performance is one of them.
- madeofpalk 5y ago> you need to eliminate all redundant calls and operations this is a no-brainer, right? The tricky part is how you identify redundant calls and eliminate them, knowing that some have more cost than others.
- onion2k 5y agothat to keep a large web application performant, you need to eliminate all redundant calls and operations, even in to pure JavaScript code That will still only result in a performant, smooth 60fps application if you can do all the calls and ops that aren't redundant in less than 11ms (16.6ms per frame, but the browser needs about 5ms to update the screen). If you're trying to do more than you can calculate in 11ms then you have to start spreading things over multiple frames hopefully doing what's most important first. This is pretty much what React's concurrent rendering claims if can do for you. If it works well it really will make applications feel significantly better. As far as I know Svelte doesn't have a solution for that. It just hopes you can get everything done in that 11ms. To be fair, 11ms is quite a lot of time on a modern computer, so unless you're doing some heavy calculation work that you can't move off the main thread to a worker you should be fine.