Hey Mason, here's the perf improvement CL I promised :)
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +1 |
I think this looks great! No notes, other than: it'd be nice to include some statistics about the performance gains you see locally when you test this patch?
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
I think this looks great! No notes, other than: it'd be nice to include some statistics about the performance gains you see locally when you test this patch?
The stats with and without this patch are pretty similar/noisy, and I think it's somewhat expected as this is the last bit of performance regression that we're reclaiming. I'd submit this patch first and let's run another pinpoint to find out if we have mitigated the regression.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
2 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the submitted one.
Optimize custom element registry lookup in HTML parser
Pre-cache the document's default CustomElementRegistry in
HTMLConstructionSite during document parsing, and gate the per-element
registry lookup in CreateElement on conditions where the registry could
actually differ from the cached value (fragment parsing or scoped
registries in use).
This avoids the repeated pointer chase through
Element::customElementRegistry() -> TreeScope -> LocalDOMWindow for
every element created during initial document parsing when scoped
registries are not in use.
Key changes:
- Thread the document's default registry from Document::CreateParser
through HTMLDocumentParser and HTMLTreeBuilder into
HTMLConstructionSite's constructor.
- In CreateElement, skip the per-element lookup when parsing a document
without scoped registries. For template content (both direct children
of <template> and deeper descendants), short-circuit to nullptr since
template content documents have no browsing context.
- Guard the customelementregistry attribute scan on registry being
non-null to skip unnecessary attribute lookups.
- Preserve the global registry on Document::Shutdown so it survives
browsing context teardown.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |