shadow.appendChild is slower in shadyDom

113 Views Asked by At

I am experimenting with WebComponents. I have used Shady DOM, to work with browsers which doesn't support Shadow DOM yet (Mozilla and IE).

I find that shadow.appendChild is significantly slower in ShadyDOM than in ShadowDOM.

Here are the JS Fiddles' for both Shadow DOM and Shady DOM.

Shady Dom : https://jsfiddle.net/lnaravindan/Lhrzapmt/3/

Have used

ShadyDOM = {force: true}; 

Shadow Dom : https://jsfiddle.net/lnaravindan/L74vju6m/4/

Have avoided ShadyDOM by

ShadowDOM = { force: false}; // Default setting

You can check the console in both fiddles for the time taken for appending content to the Shadow Root.

Average time for appending content to shadow for:

Shadow DOM is 0.06ms

Shady DOM is 0.65ms

Since I have a number of custom elements, this difference is accounting to much greater amount.

Any thoughts on this?

0

There are 0 best solutions below