Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip rule node which contains only inherited properties for rule cache #19696

Merged
merged 1 commit into from Jan 5, 2018

Conversation

@upsuper
Copy link
Member

upsuper commented Jan 5, 2018

This is one possible fix for bug 1427681 which tries to skip some rule nodes when using rule cache.

Try push for correctness: https://treeherder.mozilla.org/#/jobs?repo=try&revision=74e3941e2cfc5fba4bce839f2518af8a5a8b7411

It doesn't really show much memory saving on awsy. It only shows several KB save on fresh start memory. But since conceptually it's simple, I guess it's worth taking.


This change is Reviewable

@highfive
Copy link

highfive commented Jan 5, 2018

Heads up! This PR modifies the following files:

  • @bholley: components/style/properties/properties.mako.rs, components/style/style_resolver.rs, components/style/rule_tree/mod.rs, components/style/properties/declaration_block.rs, components/style/rule_cache.rs and 1 more
  • @canaltinova: components/style/properties/properties.mako.rs, components/style/style_resolver.rs, components/style/rule_tree/mod.rs, components/style/properties/declaration_block.rs, components/style/rule_cache.rs and 1 more
  • @emilio: components/style/properties/properties.mako.rs, components/style/style_resolver.rs, components/style/rule_tree/mod.rs, components/style/properties/declaration_block.rs, components/style/rule_cache.rs and 1 more
@highfive
Copy link

highfive commented Jan 5, 2018

warning Warning warning

  • These commits modify style code, but no tests are modified. Please consider adding a test!
@upsuper
Copy link
Member Author

upsuper commented Jan 5, 2018

r? @emilio

@highfive highfive assigned emilio and unassigned jdm Jan 5, 2018
@emilio
emilio approved these changes Jan 5, 2018
Copy link
Member

emilio left a comment

r=me if Talos / try is not mad at this.

}
}
StyleSource::None => {}
StyleSource::Style(_) => { break; }

This comment has been minimized.

@emilio

emilio Jan 5, 2018

Member

nit: no need for braces, just StyleSource::Style(_) => break,.

@@ -102,7 +134,8 @@ impl RuleCache {
return None;
}

let rules = builder_with_early_props.rules.as_ref()?;
let rules = builder_with_early_props.rules.as_ref();
let rules = RuleCache::get_rule_node_for_cache(guards, rules)?;

This comment has been minimized.

@emilio

emilio Jan 5, 2018

Member

nit: You can use Self if you want.

/// rule, nor containing any declaration of reset property. We don't
/// skip style rule so that we don't need to walk a long way in the
/// worst case. Skipping declarations rule nodes should be enough
/// to address common cases that rule cache fails to do reasonable

This comment has been minimized.

@emilio

emilio Jan 5, 2018

Member

You mean s/rule cache/style sharing cache? The rule cache should hopefully get a decent sharing now :)

This comment has been minimized.

@upsuper

upsuper Jan 5, 2018

Author Member

I mean, the common case that rule cache failed to do without this...

This comment has been minimized.

@emilio

emilio Jan 5, 2018

Member

ok, fair, maybe would fail [...] instead instead?

@upsuper upsuper force-pushed the upsuper-forks:rule-cache-opt branch from c8a1696 to 3593392 Jan 5, 2018
@upsuper
Copy link
Member Author

upsuper commented Jan 5, 2018

@bors-servo r=emilio

@bors-servo
Copy link
Contributor

bors-servo commented Jan 5, 2018

📌 Commit 3593392 has been approved by emilio

@bors-servo
Copy link
Contributor

bors-servo commented Jan 5, 2018

Testing commit 3593392 with merge f58bef3...

bors-servo added a commit that referenced this pull request Jan 5, 2018
Skip rule node which contains only inherited properties for rule cache

This is one possible fix for [bug 1427681](https://bugzilla.mozilla.org/show_bug.cgi?id=1427681) which tries to skip some rule nodes when using rule cache.

Try push for correctness: https://treeherder.mozilla.org/#/jobs?repo=try&revision=74e3941e2cfc5fba4bce839f2518af8a5a8b7411

It doesn't really show much memory saving on awsy. It only shows several KB save on fresh start memory. But since conceptually it's simple, I guess it's worth taking.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/19696)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Jan 5, 2018

💔 Test failed - mac-rel-wpt1

@upsuper
Copy link
Member Author

upsuper commented Jan 5, 2018

@bors-servo
Copy link
Contributor

bors-servo commented Jan 5, 2018

Testing commit 3593392 with merge 6131371...

bors-servo added a commit that referenced this pull request Jan 5, 2018
Skip rule node which contains only inherited properties for rule cache

This is one possible fix for [bug 1427681](https://bugzilla.mozilla.org/show_bug.cgi?id=1427681) which tries to skip some rule nodes when using rule cache.

Try push for correctness: https://treeherder.mozilla.org/#/jobs?repo=try&revision=74e3941e2cfc5fba4bce839f2518af8a5a8b7411

It doesn't really show much memory saving on awsy. It only shows several KB save on fresh start memory. But since conceptually it's simple, I guess it's worth taking.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/19696)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Jan 5, 2018

@bors-servo bors-servo merged commit 3593392 into servo:master Jan 5, 2018
3 checks passed
3 checks passed
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
homu Test successful
Details
@upsuper upsuper deleted the upsuper-forks:rule-cache-opt branch Jan 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

5 participants
You can’t perform that action at this time.