by m1el · 10y ago · 0 comments
I think DOM is pretty damn fast in modern browsers. `innerHTML` can be slower than creating elements from a JS object!
Here's the script I'm using for timing: https://gist.github.com/m1el/b28625b3b9261f0fab819e866133e49...
My results in Chrome are: dom: 2663.580ms, innerHTML: 10999.449ms
Isn't that the same as (among several other things) React's JSX?
I don't think people realize that all JSX is, is a way to elegantly write out something that transpiles down to a pure object representation of the DOM.
JSX and React have a few quirks where React means it's not quite a pure object, but the React devs are working on removing those.