Closed
Bug 1335863
Opened 9 years ago
Closed 9 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•9 years ago
|
||
Attachment #8832628 -
Flags: review?(emilio+bugs)
Assignee | ||
Comment 2•9 years ago
|
||
Attachment #8832629 -
Flags: review?(emilio+bugs)
Assignee | ||
Comment 3•9 years ago
|
||
Assignee | ||
Comment 4•9 years ago
|
||
Assignee | ||
Comment 5•9 years ago
|
||
Now with runtime verification in debug builds.
Attachment #8832724 -
Flags: review?(emilio+bugs)
Assignee | ||
Updated•9 years ago
|
Attachment #8832629 -
Attachment is obsolete: true
Attachment #8832629 -
Flags: review?(emilio+bugs)
Comment 6•9 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•9 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•9 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•9 years ago
|
||
Decided to give this a regular gecko try push too: https://treeherder.mozilla.org/#/jobs?repo=try&revision=60d6954898c84f08826feec35e52458688deabbf
Comment 10•9 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•9 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/2d8ebcae5098
https://hg.mozilla.org/mozilla-central/rev/dcfaa9b629bb
Status: NEW → RESOLVED
Closed: 9 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
•