4 ms·
No, the DOM is slow. I've worked on mobile projects that didn't use a single 3rd party library, no jQuery no underscore, the most I've used is polyfills for stu
by MatthewPhillips 14y ago
No, the DOM is slow. I've worked on mobile projects that didn't use a single 3rd party library, no jQuery no underscore, the most I've used is polyfills for stuff like Function.prototype.bind etc.
It doesn't matter. When you have a non-trivial thing to render in a list, not just a div with text content, and you start to scroll the browser stutters. Even if the list isn't particularly long (< 50 items).
CSS animations are also rather slow in mobile browsers although this is getting better with every release.
I actually find it a little bothersome that so much browser development these days is focused on JavaScript performance and JavaScript alternatives whether it is Dart or asm.js or whatever... when the DOM is the primary reason lag exists.
- dsego 14y agoYeah, the problem is if anything changes or even if you ask for the width of an element, it has to for some reason reflow everything or at least a big portion of it. So you have to keep interactions with element positions and dimensions to a minimum.