3 ms·
It’s understandable that keep it simple is a good technical rule. But it is also interesting for app developers who have to use some kind of inplace dom modific
by wruza 6y ago
It’s understandable that keep it simple is a good technical rule. But it is also interesting for app developers who have to use some kind of inplace dom modifications. Personally, I don’t (yet) see how an in-browser html parser could be much faster than createElement from e.g. hyperscript driven by pojo. It is basically the same recursive process, with an exception that small updates generate small modifications in the latter.
- giantrobot 6y agoWith jQuery (as an example) when you change elements it does so on the live DOM. This often causes the browser to re-layout, re-render, and re-draw content. If you create a thousand elements in a loop that's tons of extra work for the browser and blocks interactivity. You can do batch updates or non-display elements but it's not (or at least wasn't) built into jQuery. It's faster but more complicated. With React and the like they operate on a copy of the DOM and automatically batch updates to it. All of the changes are applied at once so there's fewer layout, render, and draw events. Part of the problem with jQuery is there's a cohort of web "developers" that grew up with it. Instead of learning the actual web stack they learned jQuery. Everything is put together (slowly) with jQuery. Even if they've been promoted out of junior positions they're not PMs or marketing drones requiring slow scripts because they're written in a style they understand.