📍 Job mac-m1_mini_2020-perf/speedometer3 complete.
See results at: https://pinpoint-dot-chromeperf.appspot.com/job/15529bc1890000
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Steinar H Gunderson abandoned this change.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Member<const ComputedStyle> layout_parent_style;Ouch. I guess various adjustments depend on this, and you rejected the idea of making those adjustments uncacheable?
bool StyleAdjuster::CanCacheStyleAdjustment(I think it's worth getting rid of this to avoid having two different places where we check the cache eligibility. We can probably just do the base appearance adjustment during "RunUncacheableStyleAdjustment", and return `kIsNotElement` for top layer elements?
EDIT: Oh, or perhaps subsequent adjustments depend the base appearance adjustments?
const StyleResolverState& state,Can we pass the `LayoutParentStyle()` instead, if that's all we need? The cleanest thing would be to only depend on `Element`, but it looks like we can at least detach it from the style resolution state of the current element.
const Element& element) {It's documented elsewhere, but I think it's worth adding a reminder here that `{ElementType::kIsNotElement}` means "cannot cache the style adjustment for this element".
// Depending on feautre flags, these coule make IsRenderedInTopLayer()nit
builder.SetIsOriginalDisplayInlineType(
style_to_clone->IsOriginalDisplayInlineType());Huh? Won't the correct "original" value already be in the cache? I'm confused.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Member<const ComputedStyle> layout_parent_style;Ouch. I guess various adjustments depend on this, and you rejected the idea of making those adjustments uncacheable?
Yes. I could try to benchmark with and without, but at some point, we're just making more and more uncacheable stuff and it seems like a very bad place to be?
I think it's worth getting rid of this to avoid having two different places where we check the cache eligibility. We can probably just do the base appearance adjustment during "RunUncacheableStyleAdjustment", and return `kIsNotElement` for top layer elements?
EDIT: Oh, or perhaps subsequent adjustments depend the base appearance adjustments?
Done
Can we pass the `LayoutParentStyle()` instead, if that's all we need? The cleanest thing would be to only depend on `Element`, but it looks like we can at least detach it from the style resolution state of the current element.
Done
It's documented elsewhere, but I think it's worth adding a reminder here that `{ElementType::kIsNotElement}` means "cannot cache the style adjustment for this element".
Done
// Depending on feautre flags, these coule make IsRenderedInTopLayer()Steinar H Gundersonnit
Quack
builder.SetIsOriginalDisplayInlineType(
style_to_clone->IsOriginalDisplayInlineType());Huh? Won't the correct "original" value already be in the cache? I'm confused.
When we “clone” the MPC hit, we don't actually clone it; a lot of bits just get reset to the default values. That's what we're fixing here.
| Code-Review | +1 |
Member<const ComputedStyle> layout_parent_style;Steinar H GundersonOuch. I guess various adjustments depend on this, and you rejected the idea of making those adjustments uncacheable?
Yes. I could try to benchmark with and without, but at some point, we're just making more and more uncacheable stuff and it seems like a very bad place to be?
Ack
if (element_type_for_cache.CacheEntryIsStyleAdjusted() &&
StyleAdjuster::CanCacheStyleAdjustment(builder)) {
StyleAdjuster::AdjustComputedStyle(state, element_if_not_pseudo);
MaybeAddToMatchedPropertiesCache(state, cache_success.key,
element_type_for_cache);
} else {
MaybeAddToMatchedPropertiesCache(state, cache_success.key,
/*element_type=*/{});
StyleAdjuster::AdjustComputedStyle(state, element_if_not_pseudo);
}
}We need to keep the ability of caching unadjusted styles? I expected:
```suggestion
if (element_type_for_cache.CacheEntryIsStyleAdjusted()) {
StyleAdjuster::AdjustComputedStyle(state, element_if_not_pseudo);
MaybeAddToMatchedPropertiesCache(state, cache_success.key,
element_type_for_cache);
} else {
MaybeAddToMatchedPropertiesCache(state, cache_success.key,
/*element_type=*/{});
StyleAdjuster::AdjustComputedStyle(state, element_if_not_pseudo);
}
}
```
builder.SetIsOriginalDisplayInlineType(
style_to_clone->IsOriginalDisplayInlineType());Steinar H GundersonHuh? Won't the correct "original" value already be in the cache? I'm confused.
When we “clone” the MPC hit, we don't actually clone it; a lot of bits just get reset to the default values. That's what we're fixing here.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Commit-Queue | +2 |
if (element_type_for_cache.CacheEntryIsStyleAdjusted() &&
StyleAdjuster::CanCacheStyleAdjustment(builder)) {
StyleAdjuster::AdjustComputedStyle(state, element_if_not_pseudo);
MaybeAddToMatchedPropertiesCache(state, cache_success.key,
element_type_for_cache);
} else {
MaybeAddToMatchedPropertiesCache(state, cache_success.key,
/*element_type=*/{});
StyleAdjuster::AdjustComputedStyle(state, element_if_not_pseudo);
}
}We need to keep the ability of caching unadjusted styles? I expected:
```suggestion
if (element_type_for_cache.CacheEntryIsStyleAdjusted()) {
StyleAdjuster::AdjustComputedStyle(state, element_if_not_pseudo);
MaybeAddToMatchedPropertiesCache(state, cache_success.key,
element_type_for_cache);
} else {
MaybeAddToMatchedPropertiesCache(state, cache_success.key,
/*element_type=*/{});
StyleAdjuster::AdjustComputedStyle(state, element_if_not_pseudo);
}
}
```
Done
builder.SetIsOriginalDisplayInlineType(
style_to_clone->IsOriginalDisplayInlineType());Steinar H GundersonHuh? Won't the correct "original" value already be in the cache? I'm confused.
Anders Hartvoll RuudWhen we “clone” the MPC hit, we don't actually clone it; a lot of bits just get reset to the default values. That's what we're fixing here.
OK ... does that produce the right result?(!)
Seemingly; it's been that way forever. But as the comment says, perhaps we should change it at some point to be a more true clone.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
45 is the latest approved patch-set.
The change was submitted with unreviewed changes in the following files:
```
The name of the file: third_party/blink/renderer/core/css/resolver/style_resolver.cc
Insertions: 9, Deletions: 3.
The diff is too large to show. Please review the diff.
```
Cache StyleAdjusted styles in the MPC.
The MPC has always contained ComputedStyles that are unadjusted
by StyleAdjuster; change this so that it can also hold adjusted ones.
We cannot always cache the result, in particular if it depends on
too esoteric properties of the Element, but in order to avoid
regressions in cases where many Elements behave like that,
we still support storing unadjusted ComputedStyles in such cases.
There is also a runtime feature flag to easily turn this off
in prod, should it cause serious bugs. The StyleAdjuster is a
complicated piece of code, and even though all dependencies
have been checked by manual inspection, it is possible that
something is not adequately covered by tests.
Style perftest (Zen 3, LTO but no PGO):
Initial style (µs) Before After Perf 95% CI (BCa)
=================== ========= ========= ======= =================
ECommerce 5360 5237 +2.4% [ +1.7%, +3.2%]
Encyclopedia 42689 41992 +1.7% [ -1.8%, +4.0%]
Extension 54348 52184 +4.1% [ +3.3%, +5.1%]
News 19970 20045 -0.4% [ -1.0%, +0.1%]
Search 7612 7535 +1.0% [ +0.2%, +2.1%]
Social1 12815 12818 -0.0% [ -0.7%, +0.5%]
Social2 8464 8374 +1.1% [ +0.5%, +1.6%]
Sports 25901 26040 -0.5% [ -1.0%, +0.1%]
Video 17033 16745 +1.7% [ +0.5%, +3.0%]
Geometric mean +1.2% [ +0.7%, +1.7%]
Recalc style (µs) Before After Perf 95% CI (BCa)
=================== ========= ========= ======= =================
ECommerce 2832 2634 +7.5% [ +6.1%, +8.7%]
Encyclopedia 30396 28776 +5.6% [ +4.8%, +6.4%]
Extension 42348 40258 +5.2% [ +4.1%, +6.4%]
News 8273 7987 +3.6% [ +2.6%, +4.6%]
Search 2643 2496 +5.9% [ +4.9%, +7.1%]
Social1 5005 4785 +4.6% [ +3.8%, +5.4%]
Social2 3809 3600 +5.8% [ +5.0%, +6.8%]
Sports 10098 9850 +2.5% [ +1.8%, +3.4%]
Video 6267 5931 +5.7% [ +4.6%, +6.8%]
Geometric mean +5.1% [ +4.3%, +5.9%]
Speedometer3, _including_ the previous QualifiedNameWithHash changes
because they are fairly closely intertwined (M1 Pinpoint, LTO but
no PGO, significant results at 99% CI only):
Editor-TipTap [ +0.1%, +0.4%]
NewsSite-Next [ -0.4%, -0.1%]
TodoMVC-Backbone [ -0.5%, -0.1%]
TodoMVC-Vue [ -0.5%, -0.1%]
TodoMVC-jQuery [ -1.0%, -0.1%]
TodoMVC-React-Complex-DOM [ -0.7%, -0.2%]
TodoMVC-JavaScript-ES5 [ -1.2%, -0.6%]
Score [ +0.0%, +0.3%]
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |