Closed
Bug 1430951
Opened 8 years ago
Closed 8 years ago
Avoid element name atomizing to improve performance of LookupCustomElementDefinition
Categories
(Core :: DOM: Core & HTML, enhancement, P2)
Core
DOM: Core & HTML
Tracking
()
RESOLVED
FIXED
mozilla60
| Tracking | Status | |
|---|---|---|
| firefox60 | --- | fixed |
People
(Reporter: edgar, Assigned: edgar)
References
Details
Attachments
(1 file)
From profile [1] in bug 1396575 comment #9, I found we spend some time atomizing aLocalName when looking up definition [2]. And the caller usually pass nodeInfo->LocalName() as aLocalName, like [3]. It looks like we could use nodeInfo->NameAtom() given that these codes are only called with element's nodeInfo which the LocalName() and NameAtom() should be the same value [4].
[1] https://perf-html.io/public/708b78ee5c83e942269ea6b20795464b61337624/calltree/?hiddenThreads=&invertCallstack&range=2.6524_2.7236&thread=5&threadOrder=0-2-3-4-5-1&transforms=f-combined-xAi-i&v=2
[2] https://searchfox.org/mozilla-central/rev/41925c0b6c6d58578690121de439d2a8d3d690f3/dom/base/CustomElementRegistry.cpp#290
[3] https://searchfox.org/mozilla-central/rev/41925c0b6c6d58578690121de439d2a8d3d690f3/dom/base/nsContentUtils.cpp#10012
[4] https://searchfox.org/mozilla-central/rev/48cbb200aa027a0a379b6004b6196a167344b865/dom/base/NodeInfo.cpp#79,89
| Comment hidden (mozreview-request) |
| Assignee | ||
Comment 2•8 years ago
|
||
| Assignee | ||
Updated•8 years ago
|
Attachment #8943142 -
Flags: review?(bugs)
Comment 3•8 years ago
|
||
| mozreview-review | ||
Comment on attachment 8943142 [details]
Bug 1430951 - Avoid element name atomizing to improve performance of LookupCustomElementDefinition;
https://reviewboard.mozilla.org/r/213432/#review219336
::: dom/base/nsContentUtils.cpp:9926
(Diff revision 1)
> NodeInfo* nodeInfo = aElement->NodeInfo();
> RefPtr<nsAtom> typeAtom =
> aElement->GetCustomElementData()->GetCustomElementType();
> CustomElementDefinition* definition =
> nsContentUtils::LookupCustomElementDefinition(nodeInfo->GetDocument(),
> - nodeInfo->LocalName(),
> + nodeInfo->NameAtom(),
Could you assert somewhere here that
MOZ_ASSERT(nodeInfo->NameAtom()->Equals(nodeIno->LocalName()))
Attachment #8943142 -
Flags: review?(bugs) → review+
| Assignee | ||
Comment 4•8 years ago
|
||
| mozreview-review-reply | ||
Comment on attachment 8943142 [details]
Bug 1430951 - Avoid element name atomizing to improve performance of LookupCustomElementDefinition;
https://reviewboard.mozilla.org/r/213432/#review219336
> Could you assert somewhere here that
> MOZ_ASSERT(nodeInfo->NameAtom()->Equals(nodeIno->LocalName()))
Will do.
| Comment hidden (mozreview-request) |
| Assignee | ||
Comment 6•8 years ago
|
||
Pushed by top12345tw@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/53d7ccf627fa
Avoid element name atomizing to improve performance of LookupCustomElementDefinition; r=smaug
Comment 8•8 years ago
|
||
| bugherder | ||
Status: NEW → RESOLVED
Closed: 8 years ago
status-firefox60:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla60
You need to log in
before you can comment on or make changes to this bug.
Description
•