4 ms·
One-hundred Shadow DOM Elements, each with 10 DOM elements and 10 CSS selectors. vs One-thousand `regular` DOM Elements with 1000 CSS selectors. It's a simpl
by solidr53 11y ago
One-hundred Shadow DOM Elements, each with 10 DOM elements and 10 CSS selectors.
vs
One-thousand `regular` DOM Elements with 1000 CSS selectors.
It's a simple math. 10 times faster.
- BinaryIdiot 11y agoI don't think that's a fair comparison. Why would you need so many selectors in the 'regular' case and what are they doing? I've worked on some pretty complex apps and have never even come close to 200 selectors in total; probably not even 100 but I'm not 100% sure. Shadowdom allows for specific targeting within a component; is that necessary faster than a query using another element / class name for targeting a component in "regular" usage? I'm curious on the numbers here as I don't know that you're necessary right or wrong here.