aboutsummaryrefslogtreecommitdiffstats
path: root/components/style/servo/restyle_damage.rs
diff options
context:
space:
mode:
authorEmilio Cobos Álvarez <emilio@crisal.io>2020-09-08 10:33:03 +0000
committerEmilio Cobos Álvarez <emilio@crisal.io>2021-02-26 16:44:05 +0100
commitad0f63769cbcd7e6b4860f0c9179f58c8c8a7485 (patch)
tree19a0c295a4d6c62b9e32af7c7406e39e66ac3c8a /components/style/servo/restyle_damage.rs
parentcd7619dbf64493bccbab28c1ea3cb50b74c81cd8 (diff)
downloadservo-ad0f63769cbcd7e6b4860f0c9179f58c8c8a7485.tar.gz
servo-ad0f63769cbcd7e6b4860f0c9179f58c8c8a7485.zip
style: Speed up custom property diffing.
When entering or leaving fullscreen in youtube, we spend most of the restyle time diffing custom properties, under IndexMap::eq. Turns out that IndexMap equality is not order-aware, and thus you actually need to make a hashmap lookup for each entry in the map, which is unnecessarily inefficient. Instead, just compare the iterators. See https://github.com/bluss/indexmap/issues/153. Differential Revision: https://phabricator.services.mozilla.com/D89434
Diffstat (limited to 'components/style/servo/restyle_damage.rs')
-rw-r--r--components/style/servo/restyle_damage.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/components/style/servo/restyle_damage.rs b/components/style/servo/restyle_damage.rs
index cee0e486f3f..fe17fa6198b 100644
--- a/components/style/servo/restyle_damage.rs
+++ b/components/style/servo/restyle_damage.rs
@@ -254,7 +254,7 @@ fn compute_damage(old: &ComputedValues, new: &ComputedValues) -> ServoRestyleDam
// Paint worklets may depend on custom properties,
// so if they have changed we should repaint.
- if old.custom_properties() != new.custom_properties() {
+ if !old.custom_properties_equal(new) {
damage.insert(ServoRestyleDamage::REPAINT);
}