Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(665)

Issue 1590143002: removeBetween() -> detach() performance fix. (Closed)

Created:
4 years, 11 months ago by rune
Modified:
4 years, 11 months ago
Reviewers:
esprehn
CC:
blink-reviews, blink-reviews-dom_chromium.org, chromium-reviews, dglazkov+blink, eae+blinkwatch, rwlbuis, sof
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

removeBetween() -> detach() performance fix. In [1] we started to persist invalidation sets on elements getting reattach style change because sibling invalidation sets scheduled on detached elements still need to be processed for attached siblings. However, the invalidation sets need to be cleared when such elements are removed from the document tree. Clearing that invalidation set were done with a detach() which also would go through detach() on an already detached subtree. That caused a performance regression in the the blink_perf.dom:select-single-add micro benchmark. Instead of brute forcing with detach(), we clear the invalidation sets for the elements of the disconnected subtree in Element::removedFrom(). [1] https://codereview.chromium.org/1533683002 R=esprehn@chromium.org BUG=577439 TEST=PerformanceTests/DOM/select-single-add.html Committed: https://crrev.com/658484182e5782d3354edb4ca40be18e93f98e30 Cr-Commit-Position: refs/heads/master@{#369798}

Patch Set 1 #

Total comments: 3

Patch Set 2 : Rebased #

Patch Set 3 : Clear invalidation in Element::removedFrom. #

Total comments: 2

Patch Set 4 : Check needsStyleInvalidation() before clearing. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+4 lines, -1 line) Patch
M third_party/WebKit/Source/core/dom/ContainerNode.cpp View 1 2 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/dom/Element.cpp View 1 2 3 1 chunk +3 lines, -0 lines 0 comments Download

Messages

Total messages: 23 (10 generated)
rune
4 years, 11 months ago (2016-01-15 00:25:55 UTC) #2
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1590143002/1 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1590143002/1
4 years, 11 months ago (2016-01-15 00:26:43 UTC) #3
esprehn
https://codereview.chromium.org/1590143002/diff/1/third_party/WebKit/Source/core/dom/ContainerNode.cpp File third_party/WebKit/Source/core/dom/ContainerNode.cpp (right): https://codereview.chromium.org/1590143002/diff/1/third_party/WebKit/Source/core/dom/ContainerNode.cpp#newcode612 third_party/WebKit/Source/core/dom/ContainerNode.cpp:612: document().styleEngine().styleInvalidator().clearInvalidation(toElement(oldChild)); can Element::removedFrom do this? It seems like it ...
4 years, 11 months ago (2016-01-15 00:31:45 UTC) #5
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
4 years, 11 months ago (2016-01-15 01:42:44 UTC) #7
rune
https://codereview.chromium.org/1590143002/diff/1/third_party/WebKit/Source/core/dom/ContainerNode.cpp File third_party/WebKit/Source/core/dom/ContainerNode.cpp (right): https://codereview.chromium.org/1590143002/diff/1/third_party/WebKit/Source/core/dom/ContainerNode.cpp#newcode612 third_party/WebKit/Source/core/dom/ContainerNode.cpp:612: document().styleEngine().styleInvalidator().clearInvalidation(toElement(oldChild)); On 2016/01/15 00:31:45, esprehn wrote: > can Element::removedFrom ...
4 years, 11 months ago (2016-01-15 09:42:41 UTC) #8
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1590143002/40001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1590143002/40001
4 years, 11 months ago (2016-01-15 13:23:08 UTC) #10
rune
https://codereview.chromium.org/1590143002/diff/1/third_party/WebKit/Source/core/dom/ContainerNode.cpp File third_party/WebKit/Source/core/dom/ContainerNode.cpp (right): https://codereview.chromium.org/1590143002/diff/1/third_party/WebKit/Source/core/dom/ContainerNode.cpp#newcode612 third_party/WebKit/Source/core/dom/ContainerNode.cpp:612: document().styleEngine().styleInvalidator().clearInvalidation(toElement(oldChild)); On 2016/01/15 09:42:41, rune wrote: > On 2016/01/15 ...
4 years, 11 months ago (2016-01-15 13:25:41 UTC) #12
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
4 years, 11 months ago (2016-01-15 14:40:36 UTC) #14
esprehn
Lgtm, I think you want a bit check though. https://codereview.chromium.org/1590143002/diff/40001/third_party/WebKit/Source/core/dom/Element.cpp File third_party/WebKit/Source/core/dom/Element.cpp (right): https://codereview.chromium.org/1590143002/diff/40001/third_party/WebKit/Source/core/dom/Element.cpp#newcode1534 third_party/WebKit/Source/core/dom/Element.cpp:1534: ...
4 years, 11 months ago (2016-01-15 17:07:24 UTC) #15
rune
https://codereview.chromium.org/1590143002/diff/40001/third_party/WebKit/Source/core/dom/Element.cpp File third_party/WebKit/Source/core/dom/Element.cpp (right): https://codereview.chromium.org/1590143002/diff/40001/third_party/WebKit/Source/core/dom/Element.cpp#newcode1534 third_party/WebKit/Source/core/dom/Element.cpp:1534: document().styleEngine().styleInvalidator().clearInvalidation(*this); On 2016/01/15 17:07:24, esprehn wrote: > Can we ...
4 years, 11 months ago (2016-01-15 17:22:21 UTC) #16
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1590143002/60001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1590143002/60001
4 years, 11 months ago (2016-01-15 17:23:19 UTC) #19
commit-bot: I haz the power
Committed patchset #4 (id:60001)
4 years, 11 months ago (2016-01-15 19:06:35 UTC) #21
commit-bot: I haz the power
4 years, 11 months ago (2016-01-15 19:07:22 UTC) #23
Message was sent while issue was closed.
Patchset 4 (id:??) landed as
https://crrev.com/658484182e5782d3354edb4ca40be18e93f98e30
Cr-Commit-Position: refs/heads/master@{#369798}

Powered by Google App Engine
This is Rietveld 408576698