3 ms·
To clear my understanding of your first statement, you're saying that their "lightweight / low memory" claim is invalidated by components having one unnecessary
by infogulch 6y ago
To clear my understanding of your first statement, you're saying that their "lightweight / low memory" claim is invalidated by components having one unnecessary level of nesting in DOM?
- jsf01 6y agoNo. They’re saying that it’s creating an entirely separate DOM tree unnecessarily by using shadow DOM where it isn’t needed. On a related note, I’m curious if anyone has a benchmark comparing performance and memory consumption when attaching a shadow root vs not.
- jjcm 6y agoIt's more than one unnecessary level of nesting in the DOM, it's that they're creating an entirely separate DOM tree they aren't using. I threw together a test using tachometer to demonstrate the differences: https://github.com/jjcm/shadowTests https://github.com/jjcm/shadowTests The results are here: https://raw.githubusercontent.com/jjcm/shadowTests/master/result.png https://raw.githubusercontent.com/jjcm/shadowTests/master/re... TL;DR - the withShadow element takes about twice as long to render as the withoutShadow element. Don't use them unnecessarily.