Re: [whatwg/dom] Declarative Shadow DOM (#831)

> For the purpose of quantifying the value of declarative shadow DOM, however, the most relevant measurements is about whether there is much benefit in creating a shadow root via markup vs. scripts as you’ve done in the previously experiment because that measurement focuses on script vs markup difference and gets rid of all other complicated issues with regards to SSR, which is probably outside the scope of this particular issue.

@rniwa thanks for all of the great feedback. I particularly agree with the above point - I should have stuck to my previous "pure" implementation of just declarative vs. imperative, as that is much less complicated. As you rightly pointed out, there are many ways to optimize for speed on various platforms, and my quick "real world" example is definitely not at all well-optimized. I suppose the reason I wanted to explore a more complicated example was just to find out if there were any major issues with the proposed approach, and start to see how it might be used in practice. Perhaps this example has done more to muddy those waters than it has helped!

> It appears to me the most of overhead in non-SSR example comes from repeatedly executing innerHTML of the same markup in the constructor. If you modified each custom element you have so that it would parse the HTML just once & clone the nodes instead, I'm seeing ~30% improvement on my local machine.

Thanks for pointing out the `innerHTML` overhead, and doing your own testing. I'll take a look also, and see if I see the same thing. But it wouldn't surprise me, given the points above.


-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/dom/issues/831#issuecomment-597929927

Received on Wednesday, 11 March 2020 23:28:20 UTC