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

> @smaug---- @mfreed7 : FYI, I've implemented streaming version (attach shadow root at the start tag) of this feature in WebKit and measured perf against non-streaming version (attach shadow root at the end tag like Blink currently does). The [result](https://bugs.webkit.org/show_bug.cgi?id=245817#c5) is that MutationObserver based polyfill to native non-streaming implementation is ~ 24% perf gain whereas MutationObserver based polyfill to native streaming implementation is ~29% perf gain.
> 
> There is definitely some overhead in non-streaming version compared to streaming version (~5%) but the difference seems rather small. Note that there is an end-user benefit of streaming version showing some content before the end tag of the outermost declarative shadow root is parsed, which isn't accounted in this measurement.

@rniwa, as I [mentioned](https://github.com/whatwg/html/pull/5465#issuecomment-1264146315) on the PR, I'm excited to hear you're prototyping a streaming version of this feature! Interesting performance results - but I guess not too surprising. I've [said](https://github.com/whatwg/dom/issues/831#issuecomment-1215603768) that the overhead of moving the nodes around at the closing `</template>` tag wasn't too high, so it's good to see you've confirmed that on an independent prototype. The biggest benefit of this approach is that it allows streaming, which is a highly developer-requested feature (generally, but also for DSD). [Your primary objection to streaming before](https://github.com/whatwg/dom/issues/510#issuecomment-370980398) was the complexity of modifying the parser to do streaming DSD - what did you find after prototyping it? How complex was the patch to support streaming, vs the one that attaches at the closing tag? If there's appetite to do it, I'm very happy to do the work to implement streaming DSD in Chromium. The [usage of the feature](https://chromestatus.com/metrics/feature/timeline/popularity/3196) is non-zero, and slightly higher than the "easy deprecation" threshold, but I think still ok to change given the potential for an interoperable (and streaming!) version of this feature.

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

Message ID: <whatwg/dom/issues/831/1267285562@github.com>

Received on Tuesday, 4 October 2022 16:50:28 UTC