New issue
Advanced search Search tips

Issue 678849 link

Starred by 2 users

Issue metadata

Status: Available
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 3
Type: Bug



Sign in to add a comment

Consider schedule invalidation sets on root element for ruleset invalidation

Reported by r...@opera.com, Jan 6 2017

Issue description

When we do ruleset invalidation for active stylesheet update, we currently schedule invalidation sets per element based on its attributes. Scheduling all sets on the root element might be more efficient. We avoid a pass over the dom tree and have fewer pending invalidation sets.
 
Labels: Performance

Comment 2 by r...@opera.com, Jan 9 2017

I've looked at ruleset invalidations for Facebook. The problem with scheduling all invalidation sets on the root element means we'll often have rules which are universal in the rightmost compound. These selectors show up in my printf for navigating my Facebook profile:

ForceSubtree: ._5v3q ._58jw :first-child
ForceSubtree: ._5v3q ._58jw :last-child
ForceSubtree: ._53r8 > :nth-child(1n)
ForceSubtree: ._2m3o :first-child
ForceSubtree: ._2m3p._5a5j :first-child
ForceSubtree: ._2m3p._5a5l :first-child
ForceSubtree: ._2m3p._5a5k :first-child

That means for Facebook, and I suspect many (most?) other pages, would end up with always doing full document recalcs.

Project Member

Comment 3 by bugdroid1@chromium.org, Jan 9 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/6e397619af9370372f49a4d1281d1f19b013f501

commit 6e397619af9370372f49a4d1281d1f19b013f501
Author: rune <rune@opera.com>
Date: Mon Jan 09 20:42:15 2017

Added trace for scheduleInvalidationsForRuleSets.

R=esprehn@chromium.org
BUG=678849

Review-Url: https://codereview.chromium.org/2620673002
Cr-Commit-Position: refs/heads/master@{#442332}

[modify] https://crrev.com/6e397619af9370372f49a4d1281d1f19b013f501/third_party/WebKit/Source/core/dom/StyleEngine.cpp

Interesting, I guess lets see how expensive that tree walk is on typical content. Solutions would be:

- Simple: Schedule subtree invalidation sets for the left most selector.
- Hard: Teach the invalidator about two pass selectors. So we first match the left most component, and upon matching it, schedule an invalidation set for the right most component.
Labels: Update-Quarterly
Labels: -Performance Performance-Loading
Project Member

Comment 7 by sheriffbot@chromium.org, Oct 19 2017

Labels: Hotlist-Recharge-BouncingOwner
Owner: ----
Status: Untriaged (was: Assigned)
The assigned owner "rune@opera.com" is not able to receive e-mails, please re-triage.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot

Comment 8 by nainar@chromium.org, Oct 19 2017

Labels: Hotlist-Reassign-In-Nov
Owner: nainar@chromium.org
Status: Assigned (was: Untriaged)
Labels: -Hotlist-Recharge-BouncingOwner -Hotlist-Reassign-In-Nov
Owner: futhark@chromium.org
Cc: futhark@chromium.org
Owner: ----
Status: Available (was: Assigned)
Labels: -Update-Quarterly
Project Member

Comment 12 by sheriffbot@chromium.org, Dec 6

Labels: Hotlist-Recharge-Cold
Status: Untriaged (was: Available)
This issue has been Available for over a year. If it's no longer important or seems unlikely to be fixed, please consider closing it out. If it is important, please re-triage the issue.

Sorry for the inconvenience if the bug really should have been left as Available.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Status: Available (was: Untriaged)

Sign in to add a comment