CustomElementReactionsStack::PopAndInvokeElementQueue() shows up in performance profiles even if dom.webcomponents.customelements.enabled and dom.webcomponents.enabled both are false.
In this case it is in set_value in HTMLInputElementBinding.cpp (generated code).
Oh, we do this for every operations, attributes, setters, or deleters annotated with the [CEReactions] extended attribute . Can we check if the webcomponent preferences are enabled in our codegen?  http://searchfox.org/mozilla-central/rev/48ea452803907f2575d81021e8678634e8067fc2/dom/bindings/Codegen.py#7842-7851
Created attachment 8900127 [details] [diff] [review] patch, v1 In this patch, I add webcomponent preference check in order to avoid doing [CEReactions] when webcomponent preference are disabled. Try: https://treeherder.mozilla.org/#/jobs?repo=try&revision=030c21cf02f706c3a9a4ffe70fda392373e922b6&filter-tier=1&group_state=expanded&selectedJob=125074622
Attachment #8900127 - Flags: review?(bugs)
Comment on attachment 8900127 [details] [diff] [review] patch, v1 GetCustomElementReactionsStack call should be also inside IsCustomElementEnabled check. Also, could we inline CustomElementRegistry::IsCustomElementEnabled(). This is extremely hot code after all. Even once we enable custom elements, this code should be fast for documents which don't have any custom elements. But that optimization can be done in a different bug.
Attachment #8900127 - Flags: review?(bugs) → review-
(In reply to Olli Pettay [:smaug] from comment #4) Thanks for your review. > Comment on attachment 8900127 [details] [diff] [review] > patch, v1 > > GetCustomElementReactionsStack call should be also inside > IsCustomElementEnabled check. Will do. > Also, could we inline CustomElementRegistry::IsCustomElementEnabled(). > This is extremely hot code after all. Sure. I will address them in next patch. > > > > Even once we enable custom elements, this code should be fast for documents > which don't have any custom elements. But that optimization can be done in a > different bug. File bug 1392974.
Created attachment 8900173 [details] [diff] [review] patch, v2 Address comment 4.
Attachment #8900173 - Flags: review?(bugs) → review+
Pushed by email@example.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/e2a544ea360c Avoid doing [CEReactions] if custom element preference is disabled. r=smaug
Status: NEW → RESOLVED
Last Resolved: a year ago
status-firefox57: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla57
we see a performance improvement from this patch: == Change summary for alert #8971 (as of August 23 2017 14:33 UTC) == Improvements: 9% dromaeo_dom summary linux64 pgo e10s 2,033.09 -> 2,208.32 8% dromaeo_dom summary linux64 opt e10s 1,920.19 -> 2,081.49 For up to date results, see: https://treeherder.mozilla.org/perf.html#/alerts?id=8971
You need to log in before you can comment on or make changes to this bug.