Closed
Bug 1335863
Opened 7 years ago
Closed 7 years ago
stylo: Optimize some FFI calls
Categories
(Core :: CSS Parsing and Computation, defect)
Core
CSS Parsing and Computation
Tracking
()
RESOLVED
FIXED
mozilla54
Tracking | Status | |
---|---|---|
firefox54 | --- | fixed |
People
(Reporter: bholley, Assigned: bholley)
References
(Blocks 1 open bug)
Details
Attachments
(2 files, 1 obsolete file)
7.01 KB,
patch
|
emilio
:
review+
|
Details | Diff | Splinter Review |
11.70 KB,
patch
|
emilio
:
review+
|
Details | Diff | Splinter Review |
I stress-profiled selector matching, and some FFI calls showed up that we can inline. These are in the range of 0.7%-1.4% of selector matching overhead each, which isn't a game changer, but nothing to sneeze at either.
Assignee | ||
Comment 1•7 years ago
|
||
Attachment #8832628 -
Flags: review?(emilio+bugs)
Assignee | ||
Comment 2•7 years ago
|
||
Attachment #8832629 -
Flags: review?(emilio+bugs)
Assignee | ||
Comment 3•7 years ago
|
||
https://treeherder.mozilla.org/#/jobs?repo=try&revision=9e4b5e2f9eefc1eca53138724a74d279bee1bdb6
Assignee | ||
Comment 4•7 years ago
|
||
https://treeherder.mozilla.org/#/jobs?repo=try&revision=add54df4624b8e7d4d543a8853f6ce39b3085f53
Assignee | ||
Comment 5•7 years ago
|
||
Now with runtime verification in debug builds.
Attachment #8832724 -
Flags: review?(emilio+bugs)
Assignee | ||
Updated•7 years ago
|
Attachment #8832629 -
Attachment is obsolete: true
Attachment #8832629 -
Flags: review?(emilio+bugs)
Comment 6•7 years ago
|
||
Comment on attachment 8832628 [details] [diff] [review] Part 1 - Inline Gecko_IsHTMLElementInHTMLDocument. v1 Review of attachment 8832628 [details] [diff] [review]: ----------------------------------------------------------------- ::: layout/style/ServoBindings.cpp @@ -169,5 @@ > return aElement->StyleState().ServoValue(); > } > > bool > -Gecko_IsHTMLElementInHTMLDocument(RawGeckoElementBorrowed aElement) We could keep this in debug builds and compare the result, though maybe it's not worth the churn? What do you think?
Attachment #8832628 -
Flags: review?(emilio+bugs) → review+
Comment 7•7 years ago
|
||
Comment on attachment 8832724 [details] [diff] [review] Part 2 - Inline common case parent access. v2 Review of attachment 8832724 [details] [diff] [review]: ----------------------------------------------------------------- ::: dom/base/nsIContentInlines.h @@ +53,5 @@ > + // Check if we want the flattened parent for style, and the node is the root > + // of a native anonymous content subtree parented to the document's root element. > + if (Type == nsIContent::eForStyle && aNode->IsContent() && > + aNode->AsContent()->IsRootOfNativeAnonymousSubtree() && > + aNode->OwnerDoc()->GetRootElement() == aNode->GetParentNode()) nit: I think you can use GetParent() here (moving the parent declaration above this condition). The root element is always content. ::: layout/style/ServoBindings.cpp @@ +74,5 @@ > > +#ifdef DEBUG > +bool > +Gecko_FlattenedTreeParentIsParent(RawGeckoNodeBorrowed aNode) > +{ heh, so you did it here :)
Attachment #8832724 -
Flags: review?(emilio+bugs) → review+
Assignee | ||
Comment 8•7 years ago
|
||
(In reply to Emilio Cobos Álvarez [:emilio] from comment #6) > > bool > > -Gecko_IsHTMLElementInHTMLDocument(RawGeckoElementBorrowed aElement) > > We could keep this in debug builds and compare the result, though maybe it's > not worth the churn? What do you think? I think this one is straightforward enough that it doesn't need runtime verification. (In reply to Emilio Cobos Álvarez [:emilio] from comment #7) > nit: I think you can use GetParent() here (moving the parent declaration > above this condition). The root element is always content. I ended up rearranging it in a slightly different way to avoid both content-checking the parent as well as checking the bit (since the bit implies that the node is an element).
Assignee | ||
Comment 9•7 years ago
|
||
Decided to give this a regular gecko try push too: https://treeherder.mozilla.org/#/jobs?repo=try&revision=60d6954898c84f08826feec35e52458688deabbf
Comment 10•7 years ago
|
||
Pushed by bholley@mozilla.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/2d8ebcae5098 Inline Gecko_IsHTMLElementInHTMLDocument. r=emilio https://hg.mozilla.org/integration/mozilla-inbound/rev/dcfaa9b629bb Inline common case parent access. r=emilio
Comment 11•7 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/2d8ebcae5098 https://hg.mozilla.org/mozilla-central/rev/dcfaa9b629bb
Status: NEW → RESOLVED
Closed: 7 years ago
status-firefox54:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla54
You need to log in
before you can comment on or make changes to this bug.
Description
•