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

Improved de-duping of ChildrenChanged() for Removed()'d nodes #29314

Merged
merged 1 commit into from Jun 10, 2021

Conversation

chromium-wpt-export-bot
Copy link
Collaborator

@chromium-wpt-export-bot chromium-wpt-export-bot commented Jun 9, 2021

  1. Only process ChildrenChanged() for the included root of a change.
    For example, if a <div id="root" style="display:none"> will be
    included because it is a potential relation target. If descendants
    change, the only ChildrenChanged() necessary to process is on #root.
  2. Share common code for detaching a node and queuing up the appropriate
    children changes. This simplifies ProcessInvalidatedObjects()
    by removing one of the inner loops, and enables a follow-up CL to
    remove the outer loop as well.

#1 results in a massive speedup for display none toggles. In
combination with other recent changes in
DetachAndRemoveFromChildrenOfAncestors(), is 7x faster for
many-nodes-toggle-display-none in perf_tests . This change alone
accounts for about half of the overall improvement.

Follow-ups:

  • Restore lifecycle check by processing deferred children changes via
    nodes_with_pending_children_changed_ and not queuing via the
    traditional mechanism. While doing this, look for opportunities to
    consolidate more children changed events.
  • Remove outer loop from ProcessInvalidatedObjects().

Bug: None
Change-Id: I80466fda792cd0ca6dd051065a42ba702e4cc8b1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2946971
Reviewed-by: Dominic Mazzoni <dmazzoni@chromium.org>
Commit-Queue: Aaron Leventhal <aleventhal@chromium.org>
Cr-Commit-Position: refs/heads/master@{#891343}

Copy link
Collaborator

@wpt-pr-bot wpt-pr-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The review process for this patch is being conducted in the Chromium project.

@chromium-wpt-export-bot chromium-wpt-export-bot force-pushed the chromium-export-cl-2946971 branch 4 times, most recently from 1ead61a to b4533be Compare June 10, 2021 14:50
1. Only process ChildrenChanged() for the included root of a change.
For example, if a <div id="root" style="display:none"> will be
included because it is a potential relation target. If descendants
change, the only ChildrenChanged() necessary to process is on #root.
2. Share common code for detaching a node and queuing up the appropriate
children changes. This simplifies ProcessInvalidatedObjects()
by removing one of the inner loops, and enables a follow-up CL to
remove the outer loop as well.

#1 results in a massive speedup for display none toggles. In
combination with other recent changes in
DetachAndRemoveFromChildrenOfAncestors(), is 7x faster for
many-nodes-toggle-display-none in perf_tests . This change alone
accounts for about half of the overall improvement.

Follow-ups:
- Restore lifecycle check by processing deferred children changes via
nodes_with_pending_children_changed_ and not queuing via the
traditional mechanism. While doing this, look for opportunities to
consolidate more children changed events.
- Remove outer loop from ProcessInvalidatedObjects().

Bug: None
Change-Id: I80466fda792cd0ca6dd051065a42ba702e4cc8b1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2946971
Reviewed-by: Dominic Mazzoni <dmazzoni@chromium.org>
Commit-Queue: Aaron Leventhal <aleventhal@chromium.org>
Cr-Commit-Position: refs/heads/master@{#891343}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants